ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using The Pages Module With Dynamic Content

August 09, 2012 5:18am

Subscribe [2]
  • #1 / Aug 09, 2012 5:18am

    Gareth Redfern

    86 posts

    I am experimenting with how I can use the pages module to better effect and could do with some help figuring out if the following is possible.

    I am trying to have a news page use the pages module for its top level page - outputting a list of article excerpts (limit 5) with pagination to see the remaining articles. I have the following code on my page:

    {exp:channel:entries channel="news_articles" pagination="bottom" limit="5" dynamic="no" }
    <article>
      <h3>{title}</h3>
    <p>  {if cf_news_article_image}<br />
      <figure><br />
      {exp:ce_img:single src="{cf_news_article_image}" width="100"}<br />
      </figure><br />
      {/if}<br />
      {cf_news_article_summary}<br />
      <a href="http://{url_title_path=news}">Read More…</a><br />
    </article></p>
    
    <p>{paginate}<br />
    Page {current_page} of {total_pages} pages {pagination_links}<br />
    {/paginate}</p>
    
    <p>{/exp:channel:entries}

    This works except for the pagination - which doesn’t load the next set of articles. My understanding of how the pages module works is that this would happen as you have taken the dynamic element away from segment structure. I had decided that this method would not work but then I came across this article on EE Insider:

    http://eeinsider.com/articles/simplifying-how-content-works/

    This article is doing exactly what I am trying to achieve but I can not get it to work - firstly it doesn’t set dynamic=“no” on the channel entries tag for the news so it can’t work, but I must be missing something.

    Any help would be appreciated.

  • #2 / Aug 09, 2012 9:01am

    Tyssen

    756 posts

    It’s setting dynamic=“off” (should be no) on the pages entry, not the new entries loop, so I’m guessing that the page URL must be the same as the new channel name which is how it would work in their situation.

    For what it’s worth, I don’t think you need to use the Pages module as described in that article. You could still publish the ‘static’ content for your news page in another channel, but you could create a template group for your news and simply pull the static page content into the news template along with the news channel entries.

  • #3 / Aug 09, 2012 3:30pm

    Gareth Redfern

    86 posts

    Hi Tyssen,

    Thank you for your reply - I have finally worked it out, you do need to set dynamic=“no” on the news entry for it to work. Even having the template name the same as the page name doesn’t work but the part I was missing is that I had pagination=“bottom” instead of paginate=“bottom” on the channel entries tag, a simple mistake, but I spent ages trying to figure it out!

    More info here http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#dynamic

    Thanks again,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases