3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 978 Views |
-
Default Silverstripe shortcodes failing to parse

6 December 2010 at 10:34am Last edited: 6 December 2010 10:51am
In my search results (Page_results.ss) I have got $Content.FirstParagraph.RAW
The problem is that I am seeing [[sitetree_link id=9]] on the results page, instead of the link. Is it some how failing to parse short codes? Or something I might have missed in the configuration?
Could be a bug in Silverstripe but I have not attempted to replicate in another default install.
Please advise.
Thanks
---------------------------------------------------------------------------------------------------------------------------------
Just to answer my question above (thanks to Willr)
First thing I was doing wrong is use .RAW on the content which bypasses shortcodes.
Secondly, he suggested alternative to use Summary(100) instead which still doesn't turn links in to links but atleast it doesn't show [[sitetree_link_id=9]] in the results
Lastly, you can also write a custom function and stack on top of $Content.CustomFunction to get the desired effect.
-
Re: Default Silverstripe shortcodes failing to parse

6 December 2010 at 7:59pm
The code which I sent through (in case anyone else wants it) is available - http://pastie.org/1350494.
For shortcodes to work the field must be a HTMLText field. Sadly all the Text functions don't return that type of object (hence the casting in that example)
| 978 Views | ||
|
Page:
1
|
Go to Top |


