Help - Search - Members - Calendar
Full Version: Table of contents -- Is this possible?
Movable Type Community Forum > Additional Resources > Tips and Tricks
ThatAdamGuy
Hi there,

I'd love to have a Table of Contents ("TOC") that goes far beyond the current archives.html default.

Specifically, for my main TOC, I'd like a table that included:
Entry title, date posted, primary category, and number of comments.

It'd be cool to also offer a version of this TOC filtered by topic.

Some questions...
- Would I use MTEntries instead of MTArchiveList for this stuff?
- Would the TOC-per-topic require separate files for every topic?

Any pointers would be great smile.gif
maddy
Of course, the format is probably not what you want, but here are the basic tags you'd need to use:

CODE
<MTArchiveList>
<MTEntries>
Title: <a href="<MTEntryPermalink>"><MTEntryTitle></a> | Date: <MTEntryDate> | Category: <MTEntryCategory> | Comment Count: <MTEntryCommentCount><br />
</MTEntries><br />
</MTArchiveList>


Or, sorted by category:

CODE
<MTArchiveList archive_type="Category">
<MTEntries>
<b><MTArchiveTitle></b><br />
Title: <a href="<MTEntryPermalink>"><MTEntryTitle></a> | Date: <MTEntryDate> | Category: <MTEntryCategory> | Comment Count: <MTEntryCommentCount><br />
</MTEntries><br />
</MTArchiveList>  


This assumes you're using MT2.51 - if not, change MTEntryPermalink to MTEntryLink - and that by 'topic' you were referring to the categories. smile.gif

I'd create a test page (New Index Template) and have a play around with the tags, and see how you go. smile.gif
ThatAdamGuy
Hey, thanks so much!  I will give that a try later today for sure.

And it just goes to show three things:
1) How MT really CAN do a bunch of cool stuff without that much coding.
2) That I still have yet to become really comfortable with the basic strategies of using MT tags
3) People here are very helpful.

Thanks again smile.gif
maddy
Cool. smile.gif I must use my test pages at least 5 times a day, playing around with the basic tags, and I've been using MT since July 2002. You can always learn more. smile.gif Add in those plugins, some php, and it's astounding what you can do! smile.gif
ThatAdamGuy
Okay, I'm minorly confused about one thing.  Am I creating an INDEX template or an ARCHIVE template?  I don't really understand the difference.  Hmm sad.gif
maddy
You need to create a new Index Template. smile.gif Archive templates, those are asociated with each entry you make, so, if you associate it with individual archiving, one would be published for each entry you posted, that kind of thing. smile.gif
ThatAdamGuy
Ah, okay, that makes sense!  I decided to go with my gut and create a Main Index template while I was waiting and I'm glad I guessed correctly.

Well, my Table of Contents is coming along decently (though yes, I'll be updating the navigation top and bottom thingies soon!)

Within a few months, it's likely that I'll have too many entries to make a one-page TOC practical, and then I'll have to figure out what to do!

Oh well.  Thanks again for your help!  I think this'll be useful, or at least fun on my blog smile.gif
almuhajabah
QUOTE
Within a few months, it's likely that I'll have too many entries to make a one-page TOC practical, and then I'll have to figure out what to do!

Sounds like a job for the Paginate plugin wink.gif

I use it on my archive index pages to keep them of manageable size.
ThatAdamGuy
Hmm.  I'm a huge fan of that plugin, and I love how I've been able to use it on my main and category pages and such.

But since my TOC is within a table, I'm confused as to how that plugin might be able to split things up without breaking the table.  Do you think it would still be workable?
crys
CODE
<table .... >
<tr> {the header row} <tr>

<MTPaginateContent max_bytes="{whatever}">
 <MTEntries ...>
    <tr> {tags to generate a content row} <tr>
    <$MTPaginateSectionBreak$>
 </MTEntries>
</MTPaginateContent>

<tr> {the footer row if you have one} <tr>
</table>
ThatAdamGuy
Wow, Crys, I'll have to give that a try!  At this point, my indexes aren't large enough (yet) to justify paginating them, but in another couple of months, I think that'll change.

I still don't quite intuitively get how the Paginate plugin knows to open and close table tags and the like, but I guess I need to take some things on faith, right? smile.gif

Anyway, thanks for the code snippet!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.