22849 Posts in 9710 Topics by 2803 members
General questions about getting started with SilverStripe that don't fit in any of the categories above.
|Go to End|
10 February 2011 at 2:19pm
On a site that used to be 2.3.7 I upgraded it to 2.4.4 and found that now when I use the links sidebar in the CMS the links are inserted as shortcode. However since I have overloaded Index() in my controller and
'Content' => $this->Content,
'Form' => $this->Form
The shortcode does not get parsed and so the links in Content don't work. On this site I changed my Index() function to Content() and just return $this->Content after modifying it in the function.
Can we no longer overload Index() in 2.4.4?
10 February 2011 at 8:34pm
You can still overload it, the issue you're facing is that links aren't being rewritten as the parser jumps in at the template level and it only parses HTMLText fields which in your array it is not, your returning just a string.
Solution is to return a new database object
'Content' => DBField::create('HTMLText', $this->Content);
Though if you aren't changing $this->Content in index you shouldn't even need that line as it will automatically fallback to $this->Content on the object.
|Go to Top|