Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Page Links error in FirstParagraph

Go to End

10 Posts   4572 Views


Community Member, 14 Posts

2 September 2010 at 2:38am

If there is a link to another page on the site in the first paragraph of some Content, then:

$Content.FirstParagraph outputs "[[sitetree_link id=n]]" where the link was, while

$Content.FirstParagraph(html) outputs

<a href="[sitetree_link id=n]">text-for-page-being-linked-to</a>

I am using 2.4.1 and wonder if this is a bug.


Community Member, 904 Posts

2 September 2010 at 2:50am

Looks like the text isn't getting parsed by the shortcode parser as it should. Having looked at the code, this seems to be the case and you should probably file a bug for it.


Forum Moderator, 1899 Posts

2 September 2010 at 3:15am

I just notice (and posted) about this happening within UserDefinedForms too (although the site is on 2.4.0)


Community Member, 14 Posts

2 September 2010 at 3:20am

Thanks banal, thought so. Bug submitted:


Community Member, 130 Posts

5 September 2010 at 8:49am

Edited: 05/09/2010 11:10am

Just want to point out that this is happening with all html, not just the links.

Any wysiwyg styling in the first paragraph is basically turned into bbcode.

An external link to google outputs like:[]

When I bold something it literally outputs * some text i wanted bold, but just has asterisks around it *

Has the same issue.
But...this all works fine inside the blog module.

<% if BlogEntries %>
	<% control BlogEntries %>
		<% include BlogSummary %>
	<% end_control %>

works as expected.



Community Member, 94 Posts

26 September 2010 at 9:53pm

Came across this issue similarly, in none the links were being parsed correctly for $Content.FirstSummary.

$Content.FirstSummary(html) along with the following tweak to /sapphire/core/model/fieldtypes/Text.php (Line 257):


return $data;


return ShortcodeParser::get_active()->parse($data);

Dirty short term fix via a change to core folder to boot, nevertheless it fixed the problem for me while I wait for the issue to be resolved more broadly.


Community Member, 37 Posts

21 January 2011 at 11:57pm

This doesn't work for me, I think it needs a higher priority than "middle"!
It doesn't look nice - internal/external links and text highlighted bold for example.
Any other suggestions?


Community Member, 12 Posts

9 February 2011 at 10:31pm

Edited: 09/02/2011 10:34pm

I solved this problem by post parsing my own rendered template.


  class Page extends SiteTree {
	public function PageParseTemplate( $template ) {
	    $data = $this->renderWith( $template );
	    return ShortcodeParser::get_active()->parse($data);
  <% control PreviewItems %>
  <% end_control %>

The $ line above behaves just like <% include Preview %> with all the shortcodes resolved! :-)

Go to Top