cancel
Showing results for 
Search instead for 
Did you mean: 

How to truncate streamasset content

schipmolder
Champ on-the-rise
Champ on-the-rise
Hi,

I'm working on some templates for WCM and I can get the article's content (html) fine by using the streamasset directive but can I also use the truncate directive in combination with the content returned by the stream? Or is there another way to get the article's content as a variable so i can truncate that instead?

At the moment the only way I can find is to use javascript to truncate the content which is a bit ugly.

Thanks
Skip
1 REPLY 1

marco_altieri
Star Contributor
Star Contributor
Hi,

I'm not sure that this is what you were looking for.

I had to do something similar: adding a "page break" in articles to cut the content at a position specified by editors.
I used a simple solution: a custom "AssetDirective" implementation. I think that it's also the best solution for performances.

This class is injected in wcmqs/WEB-INF/classes/wcmqs-webapp-context.xml:

<bean id="assetDirective" class="org.alfresco.wcm.client.directive.AssetDirective"/>

Regards,
Marco