21286 Posts in 5733 Topics by 2602 members
| Go to End | Next > | |
| Author | Topic: | 2191 Views |
-
Page Links error in FirstParagraph

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.
-
Re: Page Links error in FirstParagraph

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.
-
Re: Page Links error in FirstParagraph

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)
-
Re: Page Links error in FirstParagraph

2 September 2010 at 3:20am
Thanks banal, thought so. Bug submitted:
-
Re: Page Links error in FirstParagraph

5 September 2010 at 8:49am Last edited: 5 September 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:
google.com[http://www.google.com]
When I bold something it literally outputs * some text i wanted bold, but just has asterisks around it *
EDIT:
$Content.LimitWordCountXML(xxxx)
Has the same issue.
But...this all works fine inside the blog module.<% if BlogEntries %>
<% control BlogEntries %>
<% include BlogSummary %>
<% end_control %>
...works as expected.
C.b
-
Re: Page Links error in FirstParagraph

26 September 2010 at 9:53pm
Came across this issue similarly, in BlogSummary.ss 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):
Replace
return $data;
With
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.
-
Re: Page Links error in FirstParagraph

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? -
Re: Page Links error in FirstParagraph

9 February 2011 at 10:31pm Last edited: 9 February 2011 10:34pm
I solved this problem by post parsing my own rendered template.
Page.php:
class Page extends SiteTree {
...
public function PageParseTemplate( $template ) {
$data = $this->renderWith( $template );
return ShortcodeParser::get_active()->parse($data);
}
}
PreviewHolder.ss:<% control PreviewItems %>
$PageParseTemplate(Preview)
<% end_control %>
The $ line above behaves just like <% include Preview %> with all the shortcodes resolved!
| 2191 Views | ||
| Go to Top | Next > |






