A section of a site I’m building has a 2 column layout.
On the left is a list of 5 recent news entries from the news channel. Just the titles and date.
Below it is pagination to navigate through all the news.
Nav:
{exp:channel:entries
channel="news"
orderby="date"
sort="desc"
limit="5"
dynamic="yes"
pagination="bottom"
disable="categories|member_data|trackbacks"
}
<li>
<h2><a href="http://{url_title_path=">{title}</a></h2>
<p> <date>{entry_date format="{global:date_short}"}</date><br />
</li><br />
<br />
{if count==total_results}</ul></nav>{/if}<br />
<br />
{paginate}<br />
{pagination_links}<br />
<ul class="pagination"><br />
{!-- Paginate code --}<br />
{/pagination_links}<br />
{/paginate}</p>
<p> {/exp:channel:entries}On the right is the news story, on the same page.
Entry:
{exp:channel:entries
channel="news"
limit="1"
dynamic="yes"
disable="categories|member_data|pagination|trackbacks"
}
<date>{entry_date format="{global:date_short}"}</date>
<h2>{title}</h2>
<p> {body}<br />
<br />
{/exp:channel:entries}All nice and straight forward.
On the first page load, http://example.com/news/ the page loads as required. The latest 5 stories on the left and the latest story in full on the right.
Clicking the next entry down in the nav goes to http://example.com/news/second-news-entry/. The Story loads but because dynamic is yes for the left nav, only the second news entry loads in the nav, as expected. To stop the Nav channel:entries tag using the using the url I’ve set dynamic=“no”.
Then any of the 5 entries in the nav go to the correct entry url and each show the latest 5 news entries on the left.
But now because the left channel:entries tag isn’t using the url the pagination doesn’t work. http://example.com/news/P5 is ignored.
How can this page be built with both channel:entries tags using the url?