Hi Ingmar,
I’m on version 2.1.1. It’s a local dev server do no link I’m afraid. I’ll describe the scenario and show some code.
My blog has it’s own template group (‘journal’), with three templates: index.html, journal-main.html, and journal-article.html. index.html uses a conditional — here’s the code:
{if segment_2 == ""}
{embed="journal/journal-main"}
{if:else}
{embed="journal/journal-article"}
{/if}
journal-main uses a series of conditionals to display a list of posts in the usual way:
{embed="pages/header"}
<section id="container" class="group">
<section id="journal-container" class="group">
{exp:channel:entries channel="journal-entry|journal-link|journal-photo|journal-quote|journal-video" limit="2" orderby="date" paginate="bottom"}
{paginate}
{if previous_page}
<a href="http://{auto_path}class=prev-page">Previous Page</a>
{/if}
{if next_page}
<a href="http://{auto_path}class=next-page">Next Page</a>
{/if}
{/paginate}
{if channel_short_name == 'journal-link'}
<div class="link">
<h2><a href="http://{journal-link-URL}" target="_blank" rel="noopener">{title}</a></h2>
<p> {journal-link-description}<br />
<span class="date">Posted on <strong>{entry_date format="%F %j, %Y"}</strong> | <a href="http://{title_permalink=">Permalink</a></span><br />
<!-- <div class="back-to-top"><a href="#top">{site_url}/images/site-images/back-to-top.png</a></div> --><br />
</div><br />
<br />
{if:elseif channel_short_name == 'journal-quote'}<br />
<div class="quote"><br />
</p><h2><a href="http://{journal-quote-URL}">{title}</a></h2>
<p> </p><blockquote><p>{journal-quote}</p>
</blockquote>
<p> <span class="source"><a href="http://{journal-quote-URL}">{journal-quote-source}</a></span><br />
{journal-quote-description}<br />
<span class="date">Posted on <strong>{entry_date format="%F %j, %Y"}</strong> | <a href="http://{title_permalink=">Permalink</a></span><br />
<!-- <div class="back-to-top"><a href="#top">{site_url}/images/site-images/back-to-top.png</a></div> --><br />
</div><br />
<br />
{if:elseif channel_short_name == 'journal-entry'}<br />
<div class="entry"><br />
</p><h2><a href="http://{title_permalink=">{title}</a></h2>
<p> <!-- <span class="author">Written by <strong>{author}</strong></span> --><br />
{journal-entry-summary} <span class="read-more"><a href="http://{title_permalink=">Read More…</a></span><br />
<span class="date">Posted on <strong>{entry_date format="%F %j, %Y"}</strong> | <a href="http://{title_permalink=">Permalink</a></span><br />
<!-- <div class="back-to-top"><a href="#top">{site_url}/images/site-images/back-to-top.png</a></div> --><br />
</div><br />
<br />
{if:elseif channel_short_name == 'journal-photo'}<br />
<div class="photo"><br />
</p><h2><a href="http://{title_permalink=">{title}</a></h2>
<p> <figure>{journal-photo-upload}</figure><br />
{journal-photo-description}<br />
<span class="date">Posted on <strong>{entry_date format="%F %j, %Y"}</strong> | <a href="http://{title_permalink=">Permalink</a></span><br />
<!-- <div class="back-to-top"><a href="#top">{site_url}/images/site-images/back-to-top.png</a></div> --><br />
</div><br />
<br />
{if:elseif channel_short_name == 'journal-video'}<br />
<div class="video"><br />
</p><h2><a href="http://{title_permalink=">{title}</a></h2>
<p> <div class="video-container"><br />
<!-- start of embed code --><br />
{exp:videoplayer src="{journal-video-embed}"}<br />
<br />
<!-- end of embed code --><br />
</div><br />
<br />
{journal-video-description}<br />
<span class="date">Posted on <strong>{entry_date format="%F %j, %Y"}</strong> | <a href="http://{title_permalink=">Permalink</a></span><br />
<!-- <div class="back-to-top"><a href="#top">{site_url}/images/site-images/back-to-top.png</a></div> --><br />
</div><br />
<br />
{/if}<br />
<br />
<br />
<br />
{/exp:channel:entries} <br />
<br />
</section><br />
<br />
<section id="journal-archives"><br />
<br />
</p><h2>Archives</h2>
<p> <br />
{exp:channel:month_links channel="journal-entry|journal-link|journal-photo|journal-quote|journal-video" limit="50"}<br />
<br />
<a href="http://{path=journal/archives}">{month}, {year}</a></p>
<p> <br />
{/exp:channel:month_links}<br />
<br />
<br />
</section></p>
<p></section></p>
<p>{embed="pages/footer"}
My problem is this.
As you can see, journal-main.html has a monthly archive menu and next/prev pagination — these don’t work, instead the links open the most recent individual article.
I guess it’s something to do with the conditionals on index.html — but I can’t get my head around it.
Any ideas?