Plugin: enable use of components within WYSIWYG editor - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: Plugin: enable use of components within WYSIWYG editor (/showthread.php?tid=694) |
Plugin: enable use of components within WYSIWYG editor - blazer82 - 2010-05-11 Hey there If I got it right, the only place to use components is within templates (or plugins) where you can use php code. Sometimes it would be nice, to use components right while creating a site. So, I wrote a plugin to enable you to do so. While editing a site using the WYSIWYG editor you simply have to insert a placeholder like: [[Component::component-name]] This will be replaced with the components content while rendering the page. This way, you don't have to enable php parsing within site content (there's a plugin for that). May be useful for some people.. Btw: Some sort of plugin repsoitory would be nice Plugin: enable use of components within WYSIWYG editor - badcat - 2010-05-11 blazer82 Wrote:May be useful for some people.. Initial tests with this make my install of GS 2.01 shut down the admin section - white screen. I do agree re: a plugin Repository Plugin: enable use of components within WYSIWYG editor - blazer82 - 2010-05-11 badcat Wrote:blazer82 Wrote:May be useful for some people.. I do also work on 2.01 But, oh.. I see. I used some feature only available since php 5.3 This may cause your problem. I'll attach a version that should also work with other versions of php. Plugin: enable use of components within WYSIWYG editor - badcat - 2010-05-12 blazer82 Wrote:But, oh.. I see. I used some feature only available since php 5.3 If I understand this correctly, I would have a component normally place in my theme as: Code: <?php get_component('tagline'); ?> But now I can simply paste into my Wysiwyg editor: Code: [[Component::tagline]] Is this correct? If so, it's not working for me. I've tried it with components that have PHP in them and also ones that do not have PHP in them - but neither works for me. What did I miss? And FYI, yes - I was running PHP 5.2.9 Plugin: enable use of components within WYSIWYG editor - blazer82 - 2010-05-12 badcat Wrote:If I understand this correctly, I would have a component normally place in my theme as: Yes, that's how it is supposed to work. Is your placeholder [[Component::tagline]] gonna be replaced by an empty string or is it not gonna be replaced at all? Plugin: enable use of components within WYSIWYG editor - badcat - 2010-05-12 blazer82 Wrote:Is your placeholder [[Component::tagline]] gonna be replaced by an empty string or is it not gonna be replaced at all?Hmm - now I'm really confused. I *thought* it would be replaced with what was in the component. My component is pre-exisiting. I see the problem now... I was trying to use your plugin along with n00dle's "Custom Fields" which is allowing me to load page content into other pages. The 2 plugins do not mix well. Adding your shortcode into the wysiwyg of a top level page does work as intended. |