21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 752 Views |
-
Combine.BigSummary with NoHTML

15 July 2010 at 3:17pm
I want to display roughly the first 50 characters WITHOUT html.
This does NOT work:
$Content.NoHTML.BigSummary(22)
The problem with BigSummary is that it returns content inside of HTML tags.
-
Re: Combine.BigSummary with NoHTML

15 July 2010 at 7:08pm
The template parser doesn't support chaining methods like that. You may be able to do something like
<% control Content %>$NoHTML.BigSummary(22)<% end_control %>
-
Re: Combine.BigSummary with NoHTML

16 July 2010 at 12:26am
That is a good idea but it doesn't work. It returns nothing.
-
Re: Combine.BigSummary with NoHTML

16 July 2010 at 9:03am
Damn what a shame I thought it would. It *should* work in my head but I guess it doesn't. So you'll have to write your own bit of PHP for this.
In the model of the object you want to use that on (eg Page) try the following function. This saves the value generated by NoHTML as a Text object so you can then call BigSummary on it
function getNoHTMLContent() {
$nohtml = DBField::create('Text', $this->dbObject('Content')->NoHTML());
return $nohtml;
Then because that returns a Text object you should be able to call $NoHTMLContent.BigSummary(22)
| 752 Views | ||
|
Page:
1
|
Go to Top |


