Help - Search - Members - Calendar
Full Version: Special Category Navigation (menu Concept)
Movable Type Community Forum > Additional Resources > Tips and Tricks
Milohoss
Hi guys, it's been a while, but need help with something I don't *think* should be too hard.

On my CATEGORY ARCHIVE pages, I want to have the following in a sidebar: A list of all categories, with recent entries broken out under the category that I am currently looking at. Thus, if I am in the APPLES page:

BANANAS
PRUNES
APPLES
> apple article
> apple article
> apple article
GRAPES
MANGOS

Likewise, I'd like the same sort of nav on each indiv archive page too. Any thoughts?

Thanks!!!
caribou sue
Hi Milo,
I just figured this out for pages and folders, but entries and categories are the same idea.
It was way harder than I thought it would be, but maybe there's a more elegant way to do it. smile.gif
See this post for the code.


QUOTE (Milohoss @ Apr 28 2008, 04:39 PM) *
Hi guys, it's been a while, but need help with something I don't *think* should be too hard.

On my CATEGORY ARCHIVE pages, I want to have the following in a sidebar: A list of all categories, with recent entries broken out under the category that I am currently looking at. Thus, if I am in the APPLES page:

BANANAS
PRUNES
APPLES
> apple article
> apple article
> apple article
GRAPES
MANGOS

Likewise, I'd like the same sort of nav on each indiv archive page too. Any thoughts?

Thanks!!!

Milohoss
That's cool... my head is kinda blown by that. Would I just substitue "categoryLabel" or whatever for folder?
Milohoss


Can you help me with something really basic? If I can get past this, then I think I'm ok. Just a simple list of categories with the current category having the word HELLO WORLD under it. Here's what I'm trying, obviously doesn't work:


CODE
<MTSetVarBlock name="categoryname"><MTCategoryLabel></MTSetVarBlock>

<ul>
<MTCategories>
<li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel regex="RemoveLeadingDigits"$></a></li>
<MTIfCategory label="$categoryname">
HELLO WORLD
<MTElse>
NOTHING
</MTElse>
</MTIfCategory>
</MTCategories>
<ul>


Can you tell me what's wrong? Here's the test page - http://www.climatecycle.com/the-ride/

THANKS!!!
caribou sue
Hi Milo,
Hmm.. It might be that when you define $categoryname, you'll need to tell MT that you want the current entry's category. How about:
<MTSetVarBlock name="categoryname"><MTEntryCategory><MTCategoryLabel></MTEntryCategory></MTSetVarBlock>
Does that work?

When in doubt, it helps to throw <MTGetVar="$categoryname"> in there so you can see how the variable is defined, and troubleshoot why it's not matching up.

QUOTE (Milohoss @ Apr 30 2008, 04:46 PM) *
Can you help me with something really basic? If I can get past this, then I think I'm ok. Just a simple list of categories with the current category having the word HELLO WORLD under it. Here's what I'm trying, obviously doesn't work:


CODE
<MTSetVarBlock name="categoryname"><MTCategoryLabel></MTSetVarBlock>

<ul>
<MTCategories>
<li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel regex="RemoveLeadingDigits"$></a></li>
<MTIfCategory label="$categoryname">
HELLO WORLD
<MTElse>
NOTHING
</MTElse>
</MTIfCategory>
</MTCategories>
<ul>


Can you tell me what's wrong? Here's the test page - http://www.climatecycle.com/the-ride/

THANKS!!!

Milohoss

Interesting. Maybe the var is not being set at all! If I do this, I get nothing:

CODE
<MTSetVarBlock name="categoryname">HELLLLLLLLOOOO</MTSetVarBlock>

<MTGetVar="$categoryname">


So.... I'm on MT 3.35, is that the problem? Am I missing a plugin?

Thanks!!!
Milohoss
OK, never mind my last rambling, I'm on 4.1 now and got this to work beautifully on the category archives as follows:

CODE
<MTSetVarBlock name="categoryname"><$MTCategoryLabel$></MTSetVarBlock>

<ul>
<MTCategories>

<li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></li>

<MTIfCategory label="$categoryname">
<li><ul class="navver"><MTEntries lastn="30" offset="1">
<li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></li>
</MTEntries></ul></li>
   <MTElse></MTElse>
   </MTIfCategory>


</MTCategories>
</ul>



However, I'm having a hell of a time getting it to work on the indiv archives. Any ideas? Thanks!
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.