21489 Posts in 5783 Topics by 2622 members
|Go to End|
9 March 2013 at 4:09am Last edited: 9 March 2013 4:09am
How would I go about calling a command (tag?) from within the WYSIWYG editor, in order to place a CMS menu within the page content. EG, in the way that placing "$UserDefinedForm" within the page content editor places the form where you want it to go, and lets you have text above and below it?
I have a menu within the template that currently sits below the $Content tag, but i'd like to be able to call it from within the actual content so that I can decide precisely where it goes, eg something like:
This is my heading
Some more content
Hope this makes sense - struggling to explain it!
Cheers, L x
9 March 2013 at 12:00pm
Userforms does a basic str_replace on the content (https://github.com/silverstripe/silverstripe-userforms/blob/master/code/model/UserDefinedForm.php#L385) but a better method would be to use ShortCodes.
9 March 2013 at 12:29pm
Brilliant thanks Will! I just didn't know what terms to search for to find this info. Short codes will do exactly what I need, but the str_replace is good to be aware of too. Cheers
|Go to Top|