Help - Search - Members - Calendar
Full Version: category titles list
Movable Type Community Forum > Additional Resources > Tips and Tricks
evgeni
hi again,

I made my primary type of archiving by categories and i also have individual archive type(<$MTEntryCategory dirify="1"$>/<$MTEntryID pad="1"$>.html)

in my individual archive template i want to list all entries from current category and i don't know how to do it yet sad.gif
adamrice
This is actually not obvious, at least not to me. Here's one way to solve it.

Create a second category-archive template that contains just a list of entry titles. The entire template could read something like this:
CODE
<ul>
<MTEntries>
<li><a href="<MTEntryPermalink>"><MTEntryTitle></a></li>
</MTEntries>
</ul


Set it up on your Archiving configuration page to output a title like
CODE
<$MTEntryCategory dirify="1"$>-list.html


Use that as an include file in your individual-entry template something like this (I think).
CODE
<$MTInclude file="<MTBlogURL>/<$MTEntryCategory dirify="1"$>-list.html.html"$>


There may be a more elegant way to do this, but I confess, I'm having a hard time coming up with it.

If you're already using PHP or SSI includes, you might want to use them instead of MT includes.
evgeni
okey, here what i did and dosn't work:

i created new archive type template and put the code
CODE
<ul>
<MTEntries>
<li><a href="<MTEntryPermalink>"><MTEntryTitle></a></li>
</MTEntries>
</ul>


then i go to weblog configuration/ archiving, click on "Add new buton" and choose archive type category and template that i created.

Then i set up it's configuration like
CODE
<$MTEntryCategory dirify="1"$>-list.html


And finaly i put MTInclude tag in individual archive template
CODE
<$MTInclude file="<MTBlogURL>/<$MTEntryCategory dirify="1"$>-list.html.html"$>


when i rebult the site it gives me an error in MTInclude tag :/

so where am i wrong :/
adamrice
If you FTP to your site, do you see a bunch of category-list.html files? If so, there's probably a problem specificying the path to the files. If not, the files aren't being generated correctly.
girlie
For a Category Archive File Template, you need to use <MTArchiveCategory>, not <MTEntryCategory>.

CODE
<$MTArchiveCategory dirify="1"$>-list.html


The MTInclude does need <MTEntryCategory> though.
evgeni
i have generated category-list.html files already

now i think the problem is in the MTInclude tag because of the both quotes that cut filepath to < MTBlogURL>/<$MTArchiveCategory dirify=

CODE
<MTEntryCategory>
<$MTInclude file="<MTBlogURL>/<$MTArchiveCategory dirify="1"$>-list.html"$>
</MTEntryCategory>


how can i avoid quotes ?
kadyellebee
Which quotes are you trying to avoid? I'm wondering if embedding MT tags inside the MTInclude tag is even possible, but I haven't tested it out yet. Is PHP an option for you? That would seem to be an easier solution if so.

Are you getting an error message or is it just not including? What shows in the source of the page if it is being rebuilt?

Kristine
evgeni
Exactly, this embedding of MT tags with atributes inside MTInclude is not working so i cant get the filepath that i want to include.

I can't use php because i dont know how.

and it still give ma an error message while rebuilding site:

Building entry 'uc' failed: Build error in template 'Individual Entry Archive': Error in tag:

Use of uninitialized value in concatenation (.) or string at ...
stepan
QUOTE (evgeni @ May 10 2003, 06:59 AM)
Exactly, this embedding of MT tags with atributes inside MTInclude is not working so i cant get the filepath that i want to include.

In general, you can't put MT tags into MT tag attributes (although some plugins support this in a fashion).

To achieve what you're trying to do, you can use my brand spanking new MTIncludePlus plugin which will allow you to include the files like so:
CODE
<MTIncludeFile><$MTArchiveCategory dirify="1"$>-list.html</MTIncludeFile>
girlie
Gosh, I clearly was half asleep during that one. Bah. tongue.gif
evgeni
worx! biggrin.gif

10x to all for helping me

see ya soon
evgeni
actually it dont work properly sad.gif

when i add new entry and rebuild all the site, the include template shows me all entries from all categories not from the current
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.