Developer forum

Forum » Templates » RenderItemList probs.

RenderItemList probs.

Roop K. Rusbjerg
Reply

Hello,

I'm using Itempublisher as a news modul and feeding it with paragraph item from it's subpage:

  • News - the itempublisher is here
    • AllNews - all the news feed is here in different item paragraphs

What I want is to show latest news section at the bottom of the news details view. (check code at the bottom)

Is this possible? 

I tried to use RenderItemList, but it doesn't show anything.

Looking forward to an answer soon :) 

Best wishes,

Roop

 

The news list view template:

@GetValue("ItemPublisher:Item.Url")

<div class="row">

  <div class="nyhedslistevisning">

    @foreach (LoopItem i in GetLoop("ItemPublisher:Items.List")){

    <div class="post-row item col-md-4 col-sm-6 col-xs-12 float-left">

      <a href='@i.GetValue("ItemPublisher:Item.Url")'><img src="@i.GetValue("ItemPublisher:Item.Billede")" class="img-fluid"></a>

    <div class="newstext">

      <div class="post-date">

        @i.GetDate("ItemPublisher:Item.Oprettet").ToShortDateString()

      </div>

      <h3 class="post-title">@i.GetValue("ItemPublisher:Item.Overskrift")</h3>

      @if (!string.IsNullOrWhiteSpace(GetString("Item.Underoverskrift"))) {

      <div class="teaser">@i.GetValue("ItemPublisher:Item.Underoverskrift") </div>

 }

      <a class="arrow" href='@i.GetValue("ItemPublisher:Item.Url")'>@Translate("ReadMore","Læs mere")</a>

  </div>

</div>

}

</div>

</div>

The News detail view template:

<div class="row details">

  <div class="col-sm-8 offset-sm-2" align="center">

    <div class="post-date">Oprettet: @GetDate("ItemPublisher:Item.Oprettet").ToShortDateString()</div>

    <h1>@GetValue("ItemPublisher:Item.Overskrift")</h1>

    <br />

  </div>

  <div class="col-xs-12 col-sm-6">

    @GetValue("ItemPublisher:Item.Tekst")

  </div>

  <div class="col-xs-12 col-sm-6">

    @GetValue("ItemPublisher:Item.TxtRight")

  <div style="clear: both;">

    <a class="arrow-back" href="javascript:history.back()">@Translate("Back","Tilbage")</a>  

  </div>

  </div>


 <div class="col-sm-12">
    
    @RenderItemList(new {

            ItemType = "Nyheder",

            ListSourceType = "Page",

            ListSourcePage = "5",

            ItemFieldsList = "*",

            ListTemplate = "/Files/Templates/ItemPublisher/List/Nyheder.cshtml",

            ListPageSize = "3",

 IncludeParagraphItems= "True"

        })

</div>
</div>

Replies

 
Nicolai Pedersen
Reply

You should be able to do that. But I cannot see what is wrong as I do not have access to the site.

You will have to figure it out - or contact service desk to help you out.

BR Nicolai

 

You must be logged in to post in the forum