I have a template named RSS Feeder who looks like this:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = null;
Response.ContentType = "text/xml";
var siteURL = "http://" + Request.Url.Host;
var HomePage = Model.Content.AncestorOrSelf(1);
var pubDate = HomePage.Descendants("Hjem").OrderBy("updateDate desc");
}<?xml version="1.0" encoding="us-ascii" ?>
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<atom:link href="http://mittfirma.no/rss" rel="self" type="application/rss+xml" />
<title>MittFirma</title>
<link>@siteURL</link>
<pubdate></pubdate>
<description>MittFirma i Lister</description>
@{
foreach (var release in HomePage.Children.OrderBy("updateDate desc").Take(10))
{
<item>
<title>@release.Name</title>
@Html.Raw("<link>")@[email protected](release.Url)@Html.Raw("</link>")
<description>@release.GetPropertyValue("content")</description>
<pubdate>@release.CreateDate.ToString("r")</pubdate>
<guid>@[email protected](release.Url)</guid>
</item>
}
}
</channel>
</rss>
And here is my result:
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<atom:link href="http://mittfirma.no/rss" rel="self" type="application/rss+xml"/>
<title>MittFirma</title>
<link>http://mittfirma.no</link>
<pubdate/>
<description>MittFirma i Lister</description>
<item>
<title>Konsulent</title>
<link>http://mittfirma.no/konsulent/</link>
<description>
{ "name": "1 column layout", "sections": [ { "grid": 12, "rows": [ { "name": "Full width", "areas": [ { "grid": 12, "allowAll": false, "allowed": [ "rte", "media", "macro", "embed", "carousel", "modal", "portofolio" ], "config": { "class": "siteheader" }, "styles": { "background-image": "url(/media/1002/blue_keyboard.jpg)" }, "controls": [ { "value": "<h2>IT konsulenttjenester</h2>\n<p>Når din bedrift har behov for å hente inn ekstra ressurser til et prosjekt: HTML5 CCS3 JavaScript, ASP.NET WebForms MVC, EF, SQL databasedesign, Adobe CC, Office, Autocad, LCI mm.</p>", "editor": { "name": "Rich text editor", "alias": "rte", "view": "rte", "render": null, "icon": "icon-article", "config": {} } } ] } ], "id": "2788a6b4-4968-e4b1-7647-de9867402494" }, { "name": "Two column (3/9)", "areas": [ { "grid": 3, "allowAll": false, "allowed": [ "rte", "media", "macro", "embed", "carousel", "modal", "portofolio" ], "config": { "class": "thumbnail" }, "styles": {}, "controls": [ { "value": { "macroAlias": "SiblingMenu", "macroParamsDictionary": {} }, "editor": { "name": "Macro", "alias": "macro", "view": "macro", "render": null, "icon": "icon-settings-alt", "config": {} } } ] }, { "grid": 9, "allowAll": false, "allowed": [ "rte", "media", "macro", "embed", "carousel", "modal", "portofolio" ], "config": { "class": "thumbnail contentPadding" }, "styles": {}, "controls": [ { "value": { "macroAlias": "breadcrumb", "macroParamsDictionary": {} }, "editor": { "name": "Macro", "alias": "macro", "view": "macro", "render": null, "icon": "icon-settings-alt", "config": {} } }, { "value": "<p>MittFirma har erfaring fra en rekke disipliner. Alle erfaringer viser at oftest vil det være behov for mer enn én enkeltdisiplin ute hos oppdragsgiver. Oppdrag kan også utføres på MittFirma sitt eget kontor om ønskelig.</p>\n<p>I menyen til høyre finnes detaljer om de ulike disiplinene, hvor lang erfaringstid, eller hvilken tidsperiode arbeidserfaringen gjelder fra.</p>\n<p>Finner din bedrift én disiplin, eller en kombinasjon som passer til ditt oppdrag, eller om du kun finner beskrevet delvis det du ser etter: Nøl ikke med å ta kontakt eller send en forespørsel for nøyere gjennomgang - det kan være kompetansen som ikke er beskrevet allikevel forekommer.</p>", "editor": { "name": "Rich text editor", "alias": "rte", "view": "rte", "render": null, "icon": "icon-article", "config": {} } }, { "value": { "macroAlias": "SocialButtons", "macroParamsDictionary": {} }, "editor": { "name": "Macro", "alias": "macro", "view": "macro", "render": null, "icon": "icon-settings-alt", "config": {} } } ] } ], "id": "53119279-84c6-bf1d-fd2e-5389cf22fc31" } ] } ] }
</description>
<pubdate>Thu, 03 Dec 2015 11:04:11 GMT</pubdate>
<guid>http://mittfirma.no/konsulent/</guid>
</item>
</channel>
</rss>
<description>@release.GetPropertyValue("content")</description> are now getting the whole the text from the Grid. But how can I get some a part of this text, like eg:
MittFirma har erfaring fra en rekke disipliner. Alle erfaringer viser at oftest vil det være behov for mer enn én enkeltdisiplin ute hos oppdragsgiver. Oppdrag kan også utføres på MittFirma sitt eget kontor om ønskelig.
I menyen til høyre finnes detaljer om de ulike disiplinene, hvor lang erfaringstid, eller hvilken tidsperiode arbeidserfaringen gjelder fra.
Finner din bedrift én disiplin, eller en kombinasjon som passer til ditt oppdrag, eller om du kun finner beskrevet delvis det du ser etter: Nøl ikke med å ta kontakt eller send en forespørsel for nøyere gjennomgang - det kan være kompetansen som ikke er beskrevet allikevel forekommer.
what I consider to be the main text (look after { “value”: )?
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/74972-how-to-render-part-of-text-from-grid