Help - Search - Members - Calendar
Full Version: Add Some Html To The Category Page?
Movable Type Community Forum > Using Movable Type > Categories and Entry Tags
dmitryseliv
I have couple links that I need to show up under specific category only.
This part of the code is in a footer.
Any ideas how to do that?

Cheers, DS
shenews
I don't know for sure, but we have to start talking about what we do know if we're going to make this software work.

I've done something similar in other contexts- this involves collapsing a menu in the short permalink page, in a module called by a footer:
CODE
<mt:IfArchiveType type="individual">
<$MTInclude module="Spotlight closed"$>
<mt:else>
<$MTInclude module="Spotlight"$>
</mt:IfArchiveType>


There is a tag called IfCategory

Returns true if the current entry belongs to the designated category.
Attributes

* name
* label

Example

CODE
<mt:IfCategory label="Foo">
  <!-- do something -->
<mt:else>
  <!-- do something else -->
</mt:IfCategory>




You should be able to add your links in that "do something" place and leave the "else" part blank.

Hope this helps.

Really useful: Movable Type Template Tag Reference
dmitryseliv
Thanks for the help but that didn't work.

I end up with different solution.

<MTIfArchiveTypeEnabled archive_type="Category-Monthly">

<MTSetVarBlock name="this_cat_id"><mt:CategoryID /></MTSetVarBlock>
<mt:if name="this_cat_id" eq="4">
DO SOMETHING
</mt:if>
</MTIfArchiveTypeEnabled>

I wish they have more examples in doc how to use the Tags.

Best, DS
shenews
Good to know. Thanks for posting your solution. Future searchers will be grateful.
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.