Lindsayanng Posted July 4, 2011 Share Posted July 4, 2011 I am REALLY new to prestashop and figured I would learn a lot about it by making a simple and quick block module. I am using the BLOCKLINKS module as a base and basically copied all of the blocklinks module files over to a new one with a new name called blocktext and created new db tables and functions with the blocktext instead of blocklinks name. I am basically working on making what would be considered a "text widget" in wordpress. A plan block that you can add text to plus a WYSIWYG editor or/ HTML. So I have a pretty solid start. I started to remove the code that references URL's because I will not be using a separate input to list links. Then I removed a few other functions that aren't necessary and turned the basic text field into a text area. I have attached a screen shot of my admin and what the front end output is. Here is a link to a pastebin version of my functions file (it was too long to paste here)LINK TO BLOCKTEXT.PHPThe output is VERY simple: {if $url} {$title} {else} {$title} {/if} {foreach from=$blocklink_links item=blocklink_link} {$blocklink_link.$lang} {/foreach} The issues: 1.) I know I haven't cleared out all unnecessary code but it is kind of spaghetti code in there so any help with cleaning it is greatly appreciated2.) I really want the ability to use a WYSIWYG editor. I have successfully been able to call the TINYMCE script but it will not save the formatting to the DB3.) I would also like the ability to just insert raw HTML if the WYSIWYG doesnt work. 4.) The update/delete buttons are not stable and sometimes will not fireIf you would like to test the entire module I have also attached the full package that I am currently using. Again.. this is one part learning experience and one part attempt at making a free module for people to use. THANKS! blocktext.zip Link to comment Share on other sites More sharing options...
Recommended Posts