At long last, we're moving to forums powered by, well, Movable Type itself. You'll want to bookmark http://forums.movabletype.org/ for future reference, and in the meantime you can view these old forums as a read-only archive of past posts. Thanks for being part of the community!
![]() ![]() |
Apr 28 2008, 04:39 PM
Post
#1
|
|
|
Group: Members Posts: 541 Joined: 26-June 02 Member No.: 1,363 |
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!!! |
|
|
|
Apr 29 2008, 05:25 AM
Post
#2
|
|
|
Group: Members Posts: 125 Joined: 15-August 07 From: Canada Member No.: 43,938 |
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. See this post for the code. 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!!! -------------------- |
|
|
|
Apr 30 2008, 03:38 PM
Post
#3
|
|
|
Group: Members Posts: 541 Joined: 26-June 02 Member No.: 1,363 |
That's cool... my head is kinda blown by that. Would I just substitue "categoryLabel" or whatever for folder?
This post has been edited by Milohoss: Apr 30 2008, 03:59 PM |
|
|
|
Apr 30 2008, 04:46 PM
Post
#4
|
|
|
Group: Members Posts: 541 Joined: 26-June 02 Member No.: 1,363 |
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!!! |
|
|
|
May 1 2008, 05:41 AM
Post
#5
|
|
|
Group: Members Posts: 125 Joined: 15-August 07 From: Canada Member No.: 43,938 |
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. 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!!! -------------------- |
|
|
|
May 1 2008, 04:19 PM
Post
#6
|
|
|
Group: Members Posts: 541 Joined: 26-June 02 Member No.: 1,363 |
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!!! |
|
|
|
May 6 2008, 07:52 AM
Post
#7
|
|
|
Group: Members Posts: 541 Joined: 26-June 02 Member No.: 1,363 |
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! |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 11.24.09 - 11:41 PM |