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.

General Questions

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

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

*bold* erm?

Go to End

10 Posts   1820 Views


20 July 2009 at 2:36am Community Member, 74 Posts

Hi Guys

If I use and article page or blog or anything else if I call it to display on another page, Then the text that is in bold is displayed with asterisk around what is meant to be bold like this *bold* is this a simple css problem, whats the best way to fix it?

Thanks in advance


20 July 2009 at 3:20am (Last edited: 20 July 2009 3:25am), Community Member, 79 Posts

I am looking into the same problem, when I add $Content.LimitWordCount(30)
it removes the strong tag and leaves the asterix's around the text. Removing the limit, and leaving content makes it display correctly.

This is the article I can find on variables, all have the same affect.


20 July 2009 at 3:26am Community Member, 74 Posts

yep, same problem, has anyone solved this problem? thanks in advance


20 July 2009 at 9:18pm Community Member, 79 Posts

FireMe! any further to finding a solution to this problem?

I have been trawling through the forums, and found questions regarding this for both styles and images but I can't find a solution.

why isn't articlepage bringing through any of the styles? or formatting?


20 July 2009 at 11:29pm Community Member, 79 Posts

I found these posts regarding the issue, it seems that the html is being stripped out leaving the asterisks:

Sadly these don't seem to answer the problem, anyone have a solution?


21 July 2009 at 8:48am Community Member, 79 Posts

Well so far the best I have found is to use:


which is removing the asterisks, but also removing all the Html formatting. Does anybody have an answer on how to show a portion of the content without losing the formatting?


21 July 2009 at 6:12pm Community Member, 901 Posts

Well, the problem with cutting the html is, that you might cut your content in between opening and closing tags.
Something like:
Lorem ipsum <strong>dolor sit amet, consectetur</strong> adipiscing elit.
Might end up like this:
Lorem ipsum <strong>dolor sit amet
or like this:
Lorem ipsum <strong>dolor sit amet, consectetur</st
which is even worse. You'll end up with invalid html code in either of these scenarios.

This is quite a tricky problem, and converting to plain text is by far the easiest solution. If you find a good algorithm to limit the character or word count of html code, without generating invalid html, then you could implement your own text-parser:


21 July 2009 at 8:19pm Community Member, 79 Posts

I am not sure how I would implement a text parser. Is there any examples?

I have been looking at the blog module, looking at the code could I use something from here to pull a limited text.
How about the following? could it be adapted?

    * Get a bbcode parsed summary of the blog entry
   function ParagraphSummary(){
      if(self::$allow_wysiwyg_editing) {
         return $this->obj('Content')->FirstParagraph('html');
      } else {
         $parser = new BBCodeParser($this->Content);
         $html = new HTMLText('Content');
         return $html->FirstParagraph('html');

unfortunately this is just returning the whole text with code.
Is there a simple answer to this, I need to use this a lot in the site I am building.

Go to Top