blog posts pulled through, how to get first few characters
Hi,
I have pulled through the latest 2 blog posts using uBlogsy to my homepage, they firstly by default just pull the title of the post in a listed format. How could I get them to :
A) sit side by side, a few pixels apart so to differentiate
B) show the title and the content BUT just say the first 150chars of the content, not all of it
and C) make it not be green font (it is green i think as the title is a hyperlink
blog posts pulled through, how to get first few characters
Hi,
I have pulled through the latest 2 blog posts using uBlogsy to my homepage, they firstly by default just pull the title of the post in a listed format. How could I get them to :
A) sit side by side, a few pixels apart so to differentiate
B) show the title and the content BUT just say the first 150chars of the content, not all of it
and C) make it not be green font (it is green i think as the title is a hyperlink
a and c would be alterations to the css and/or html structure of your xslt...
b can be accomplished in the xslt, with a comination of umbraco.library:stripHtml and substring...
eg...
<xsl:variable name="strippedHTML" select="umbraco.library:StripHtml($YOURTITLE)"/>
<xsl:value-of select="substring($strippedHTML, 1, 150)" />
Hi
Thanks for the reply. I am using uBlogsy, and that uses Scriping files (.cshtml), would the same work for that?
In Razor it would look like this:
Have a look at this blogpost for more examples: http://umbraco.com/follow-us/blog-archive/2011/9/22/umbraco-razor-feature-walkthrough%E2%80%93part-8.aspx
Jeroen
is working on a reply...