0

I'm trying to display the category archive date on the landing page after the archive date is clicked in sidebar.

Here's my sidebar with category and archive links:

<div class="sidebar">
    <h2>Categories</h4>
    {exp:channel:categories channel="blog"}
        <a href="{path='blog/index'}">{category_name}</a><br />
    {/exp:channel:categories}
</div>

<div class="sidebar">
    <h2>Archives</h4>
    <ul>
    {exp:channel:month_links channel="blog" limit="50"}
        <li><a href="{path='blog/index'}">{month}, {year}</a></li>
    {/exp:channel:month_links}
    </ul>
</div>

I'm using the {exp:channel:category_heading} on the blog/index landing page and that displays category heading just fine, but can't figure out how to do the same for the archive date.

UPDATED ANSWER:

I used DT Plugin and pulled in segment variables and seems to work fine.

{exp:dt set="{segment_3}/00/{segment_2}" format="%F, %Y" ee_format="true" month="1"}

2 Answers 2

2

For EE3 you could try this plugin - https://devot-ee.com/add-ons/dt-plugin - I've not tested it but the docs suggest you should be able to get a nice date output from it.

You could always just grab the segment values in your page heading, eg

<h1>Archive for {segment_3}/{segment_2}</h1>
1
  • A bit hacky, but ya, that should work. I updated my answer above with specific code used. Thanks.
    – frshjb373
    Commented Aug 10, 2016 at 19:44
0

Assuming your month archive URL's are in format blog/[year]/[month] you could. use Low's Nice date plugin to grab the segment values and output a date in whatever format you need. http://gotolow.com/addons/low-nice-date

2
  • 1
    Is there not a way to do this out of the box in EE?
    – frshjb373
    Commented Aug 8, 2016 at 15:33
  • I should also clarify I'm on EE3...the addon recommended is only compatible with EE1 and EE2.
    – frshjb373
    Commented Aug 8, 2016 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.