Newbie here. Can someone point me to instructions on how I can add “previous month” and “next month” navigation arrows to the Calendar widget?
Thanks in advance for any help!
Reported on Movable Type 4.2
Newbie here. Can someone point me to instructions on how I can add “previous month” and “next month” navigation arrows to the Calendar widget?
Thanks in advance for any help!
Reported on Movable Type 4.2
This might work
<mt:ArchiveNext type="Monthly"> <a href="<$mt:ArchiveLink$>" title="<$mt:ArchiveTitle escape="html"$>">Next</a> <mt:Else> <!-- output when no next archive is available --> </mt:ArchiveNext>No dice. Here's the error I get when I try to publish the site:
An error occurred publishing category '3':
Publish error in template 'Category Entry Listing':
Error in tag: error in module Sidebar:
Publish error in template 'Sidebar':
Error in tag: Error in tag:
Error in tag:
error in widget Calendar:
Publish error in template 'Calendar':
Error in tag:
Error in tag:
You used an MTarchiveprevious tag without a date context set up.
Any thoughts?
Can you post your code for the calendar widget template.
Try moving the next | previous code so that it is within the <mt:Calendar> tag block.
Nope, same error. I put the blocks just inside the end of the mt:Calendar block.
If you cannot get this resolved, you might want to submit a feature request because it would be a small, but useful, feature.
FogBugs case 91780 added (feature request submitted). Thank you for your help.
hey folks!
I just started using MT, and I am going through the same thing trying to create an archive calendar.
This post was very helpful. but I'm now getting an error.
I'm posting the whole code for anyone who is interested:
<!--/module: CalendarArchive-->
apologies for the look of the code. for some reason the "pre" tags aren't working?
any tips would be appreciated.
and ya, why aren't the previous/next links part of the regular code?
and one off the cuff question for a MT beginner: What's the difference between a Module and a Widget?
Thanks!
i'm pretty sure that was the same error i got. but so that other people can help us out, you may want to use the special form to attach your code so that the code itself is legible.
as far as your question, "and one off the cuff question for a MT beginner: What's the difference between a Module and a Widget?", please don't threadjack, or else this thread will get off the topic. please post that in a new thread. thanks.
I really need the same. The archive_type modifier does not work as expected. It should always display a next or previous month if there is one and not throw a 'not in date context' error if it's a main index or individual post.
On top of that, the manual states that type and archive_type are the same modifiers. But they have different results. type produces an out of date context error on individual entries, not on main indexes, archive_type vice versa. In both cases a link to next/previous month should be given, since you specifically request for a monthly context.
This makes the calender function severely limited imo
I've found the solution:
<mt:If name="datebased_archive">
<div id="next-prev">
<div id="prev"><mt:ArchivePrevious archive_type="Monthly"><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$> »</a></mt:ArchivePrevious></div>
<div id="next"><mt:archivenext archive_type="Monthly"><a href="<$mt:ArchiveLink$>">« <$mt:ArchiveTitle$></a></mt:ArchiveNext></div>
</div>
<mt:else>
<mt:archivelist archive_type="Monthly" lastn="1">
<div id="next-prev">
<div id="prev"><mt:ArchivePrevious archive_type="Monthly"><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$> »</a></mt:ArchivePrevious></div>
<div id="next"><mt:archivenext archive_type="Monthly"><a href="<$mt:ArchiveLink$>">« <$mt:ArchiveTitle$></a></mt:ArchiveNext></div>
</div></mt:archivelist>
</mt:else>
</mt:if>
Works perfectly
Hm, works perfectly instead within the context of an individual entry. Once you click on an individual entry, the next month/previous month will result in only the previous month being linked to the previous month of the current date (in reality). It does not generate a next/prev month in respect to the date of the entry.
No way to create an archive-context in this example right?