recoil Posted August 1, 2014 Share Posted August 1, 2014 Hello all, I am trying to make a new CMS page everything goes fine until I try to edit the page, I want to put a picture. I tried entering through the insert top menu, insert picture button and directly via the source code button, I know it should look like this "<img src="mysite/img/cms/Actual.jpg" alt="" width="1024" height="683" />" the problem is that when I hit save and preview it won't display when I check the source code it has been changed to "<p><img src="http://infill3d.com/img/cms/Actual.jpg" alt="" width="1024" height="683" /></p>" Why Prestashop keeps changing it to a paragraph? Does not matter how I try to add the picture after I save it always changes to a paragraph. Thank you for help in advance. Link to comment Share on other sites More sharing options...
vekia Posted August 1, 2014 Share Posted August 1, 2014 it's not a case of prestashop, it's a case of tinymce editr it always add <p> to code, no matter where you will use it Link to comment Share on other sites More sharing options...
recoil Posted August 1, 2014 Author Share Posted August 1, 2014 Thank you Vekia, do you know how to overcome that? Since every time it adds the <p> ... </p> the picture won't display, how do I make it work? Link to comment Share on other sites More sharing options...
NemoPS Posted August 2, 2014 Share Posted August 2, 2014 Try editing the html source of the editor directly, remove the p and see if it adds it again. If it does, add the same size attributes to that tag as well Link to comment Share on other sites More sharing options...
recoil Posted August 2, 2014 Author Share Posted August 2, 2014 Hello Nemo1, thank for the help. I did try editing directly with the source editor and yes Prestashop keeps adding the <p> I can't find a way around it. I am confused when you say "add the same size attributes to that tag as well" could you please elaborate? Thank you very much. JD Link to comment Share on other sites More sharing options...
NemoPS Posted August 2, 2014 Share Posted August 2, 2014 sure (it';s tinyMCE which adds it anyway )try with <p width="1024" height="683"> or the same size with the sytle="" attribute Link to comment Share on other sites More sharing options...
recoil Posted August 2, 2014 Author Share Posted August 2, 2014 Tried it and it won't budge is very frustrating, so basically you can't add pictures to CMS since tinyMCE keeps adding the <p> every time right? Is this something that should get fixed in the future? Thank you once more Nemo1. Link to comment Share on other sites More sharing options...
musicmaster Posted August 2, 2014 Share Posted August 2, 2014 You might try to modify the <p> into <p style="display:inline"> Just an idea. I don't know if it will work but you could try. Link to comment Share on other sites More sharing options...
recoil Posted August 2, 2014 Author Share Posted August 2, 2014 Thank you Musicmaster I will try it. Link to comment Share on other sites More sharing options...
vekia Posted August 2, 2014 Share Posted August 2, 2014 it's possible to disable <p> in tinymce editor but in this case it will be necessary to modify tinymce init script. force_br_newlines : true, force_p_newlines : false whole process is described here: tinymce modification prestashop 1.6 Link to comment Share on other sites More sharing options...
recoil Posted August 2, 2014 Author Share Posted August 2, 2014 You are the man Veika I will do that. Thank you. Link to comment Share on other sites More sharing options...
vekia Posted August 3, 2014 Share Posted August 3, 2014 let me know if after modifictaion <p> is still automatically added to your text Link to comment Share on other sites More sharing options...
recoil Posted August 3, 2014 Author Share Posted August 3, 2014 Hello Vekia, is this the file /js/tinymce.inc.js? I check it but I do not see this lines "force_br_newlines : true, force_p_newlines : false" I did add them to the file, I can't attach the file to this post I get an error "tinymce.inc.js You aren't permitted to upload this kind of file" I will paste it bellow. Unfortunately it did not work it still adds the <p> Thank you for all your help. function tinySetup(config) { if(!config) config = {}; //var editor_selector = 'rte'; //if (typeof config['editor_selector'] !== 'undefined') //var editor_selector = config['editor_selector']; if (typeof config['editor_selector'] != 'undefined') config['selector'] = '.'+config['editor_selector']; // safari,pagebreak,style,table,advimage,advlink,inlinepopups,media,contextmenu,paste,fullscreen,xhtmlxtras,preview default_config = { selector: ".rte" , plugins : "colorpicker link image paste pagebreak table contextmenu filemanager table code media autoresize textcolor", toolbar1 : "code,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,|,blockquote,colorpicker,pasteword,|,bullist,numlist,|,outdent,indent,|,link,unlink,|,cleanup,|,media,image", toolbar2: "", external_filemanager_path: ad+"/filemanager/", filemanager_title: "File manager" , external_plugins: { "filemanager" : ad+"/filemanager/plugin.min.js"}, language: iso, skin: "prestashop", statusbar: false, relative_urls : false, convert_urls: false, //New lines force_br_newlines : true, force_p_newlines : false, extended_valid_elements : "em[class|name|id]", menu: { edit: {title: 'Edit', items: 'undo redo | cut copy paste | selectall'}, insert: {title: 'Insert', items: 'media image link | pagebreak'}, view: {title: 'View', items: 'visualaid'}, format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'}, table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'}, tools: {title: 'Tools', items: 'code'} } } $.each(default_config, function(index, el) { if (config[index] === undefined ) config[index] = el; }); tinyMCE.init(config); }; Link to comment Share on other sites More sharing options...
NemoPS Posted August 4, 2014 Share Posted August 4, 2014 Try adding it here adminfolderthemes\default\template\helpers\form At about line 870, should be the one being called in bo templates Link to comment Share on other sites More sharing options...
vekia Posted August 5, 2014 Share Posted August 5, 2014 what is your prestashop version (exact number) ? Link to comment Share on other sites More sharing options...
Recommended Posts