I have an umbraco 4.5.2 site that is running the old XSLT schema. I want to create an RSS feed that shows the first 200 characters of a certain type of page but without any images. Is this possible using XSLT and if so how would go about doing it? I am using the RSS feed XSLT template and I know how to only show 200 characters so the main question is how can I show only text and no images, most of the pages start with an image or have one or two images within the first 200 characters (i.e. the images are within a rich text editor document property that I am pulling in). Thanks in advance for any help
No sure why this got double posted! Thanks for the response, I am now using the following to get 350 characters, is there a nicer way of doing this or is it ok using two variables like I am? Also is it possible to finish at the end of a word or better still the end of a sentence as opposed to cutting it off half way through a word?
I created an XSLT extension the other day that would just find the second dot in a string (which would be the end of the second sentence) and then returns that. You could easily do it like: find the first dot after 350 characters.
RSS feed with no images
Hi All,
I have an umbraco 4.5.2 site that is running the old XSLT schema. I want to create an RSS feed that shows the first 200 characters of a certain type of page but without any images. Is this possible using XSLT and if so how would go about doing it? I am using the RSS feed XSLT template and I know how to only show 200 characters so the main question is how can I show only text and no images, most of the pages start with an image or have one or two images within the first 200 characters (i.e. the images are within a rich text editor document property that I am pulling in). Thanks in advance for any help
You can use the StripHtml method in the umbraco library:
No sure why this got double posted! Thanks for the response, I am now using the following to get 350 characters, is there a nicer way of doing this or is it ok using two variables like I am? Also is it possible to finish at the end of a word or better still the end of a sentence as opposed to cutting it off half way through a word?
Looks good to me!
I created an XSLT extension the other day that would just find the second dot in a string (which would be the end of the second sentence) and then returns that. You could easily do it like: find the first dot after 350 characters.
Don't suppose you would be willing to share the code you used to do that? That sounds like the perfect solution.
is working on a reply...