Modifying Razor Script to display 2 properties of document type
Hi,
I have got a document type [homepage] , where i have got 4 sections each section has a short description and long description. The short description is being displayed on the homepage while the long description should be displayed on another page when the read more link is clicked.
The test website is onhttp://acellr.tangent-design.com , where short discription is being displayed with a read more link. Can anyone assist me on how can i show long description of the 4 sections when readmore is clicked on another template. Currently i am using the following razor script on homepage:
What you could probably do is instead of having 2 different fields for the descriptions, use only one field and truncate your text in your razor file and just insert the umbraco field in the template itself.
Razor File
var yourChoice = newsItem.Children.OrderBy("createDate descending"); foreach(var page in yourChoice) { @Library.Truncate(@Library.StripHtml(page.Description), 100) }
how would i link readmore to that template , as i have got 4 sections going into that template, so for instance if i click on readmore for section one , the template should show description for that section viceversa
short description is the one which is currently being displayed on website for instance proven credentials[header], do you some time....[short description] , readmore [link to long description on which the question is based], same structure for other 3 columns[what is emotional literacy][why we need emotional..][how does emotional..] . long description should be displayed when read more is clicked on the site , but i dont know how to link the longdescription property to that link to show that on another template.
Modifying Razor Script to display 2 properties of document type
Hi,
I have got a document type [homepage] , where i have got 4 sections each section has a short description and long description. The short description is being displayed on the homepage while the long description should be displayed on another page when the read more link is clicked.
The test website is on http://acellr.tangent-design.com , where short discription is being displayed with a read more link. Can anyone assist me on how can i show long description of the 4 sections when readmore is clicked on another template. Currently i am using the following razor script on homepage:
<div class="midCenter">
<div class="header1">@Model.ThompageMidContent</div>
<p>@Model.ThompageMidShortContent</p>
<div class="more">
<a href="#" >READ MORE Link to long description</a>
</div>
</div>
<div class="midCol1">
<div class="header1">@Model.ThomepageMidCol1</div>
<p>@Model.ThomepageMidCol1ShortContent</p>
<div class="clear"> </div>
<div class="more"><a href="" > READ MORE Link to long description</a></div>
</div>
<div class="midCol2">
<div class="header1">@Model.ThomepageMidCol2</div>
<p>@Model.ThomepageMidCol2ShortContent</p>
<div class="more"><a href="" > READ MORE Link to long description</a>
</div>
</div>
<div class="midCol3">
<div class="header1">@Model.ThomepageMidCol3</div>
<p>@Model.ThomepageMidCol3ShortContent</p>
<div class="more"><a href="" > READ MORE Link to long description</a>
</div>
</div>
Document alias for long description is : ThompageMidLongContent etc. Any suggestions or advice will be highly appreciated
Hi,
What you could probably do is instead of having 2 different fields for the descriptions, use only one field and truncate your text in your razor file and just insert the umbraco field in the template itself.
Razor File
Template
<umbraco:Item field="Description" runat="server" />
Hope it helps
//fuji
how would i link readmore to that template , as i have got 4 sections going into that template, so for instance if i click on readmore for section one , the template should show description for that section viceversa
Where are the short description from the url you sent? Is it the one at the bottom with "WHAT IS EMOTIONAL LITERACY?"
short description is the one which is currently being displayed on website for instance proven credentials[header], do you some time....[short description] , readmore [link to long description on which the question is based], same structure for other 3 columns[what is emotional literacy][why we need emotional..][how does emotional..] . long description should be displayed when read more is clicked on the site , but i dont know how to link the longdescription property to that link to show that on another template.
is working on a reply...