I have a template for a blog.
When there is no segment_2 the template serves up a list of blog entries. Clicking on the entry reloads the page with the url_title as segment_2 and displays just the one entry
I use if conditions to check for segment 2 and if it is there it displays the entry.
PROBLEM:
When I use pagination and click on the next page and get /P6 as segment_2 so I do not get the second page of entries but rather a single entry.
How do I use a single template to display a blog list, a single blog entry and use pagination?
{if segment_2}
{exp:channel:entries channel="commentary" entry_url="{segment_2}" limit="1" dynamic="yes" disable="member_data|pagination"}
{BLOG}
{/exp:channel:entries}
{/if:else}
{exp:channel:entries channel="commentary" show_future_entries="no" limit="12" dynamic="no" paginate="bottom"}
<a href="http://{title_permalink=commentary}">{title}</a>
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{/exp:channel:entries}
{/if}