Help - Search - Members - Calendar
Full Version: Ifcategory Labels
Movable Type Community Forum > Using Movable Type > Categories and Entry Tags
Akotan
Hi, is there a way to filter multiples categories using only one entry, like MTEntries category filter. Something like it:

CODE
<MTIfCategory label="Blog OR Archive">
---- do something... -----
</MTIfCategory>


If this don't work, I know I'll have to use multiples instances of IfCategory... Is there a better way to achieve the same results for this?
Raffaele
Hi,

sorry for my english language.
My Idea:

CODE
<mt:IfArchiveTypeEnabled archive_type="Category">
<div class="widget-archive widget-archive-category widget">
    <h3 class="widget-header">Canali selezionati</h3>
    <div class="widget-content">

    <mt:TopLevelCategories>

<!—Codice per filtro categorie ->
<mt:SetVar name="IncludeCategory" value="false" />
<mt:IfCategory name="Cultura">
<mt:SetVar name="IncludeCategory" value="Cultura" />
</mt:IfCategory>
<mt:IfCategory name="Politica">
<mt:SetVar name="IncludeCategory" value="Politica" />
</mt:IfCategory>

<mt:If name="IncludeCategory" like="(Cultura|Politica)">

        <mt:SubCatIsFirst>
        <ul class="widget-list">
        </mt:SubCatIsFirst>
        <mt:IfNonZero tag="mt:CategoryCount">
            <li class="widget-list-item"><a href="<$mt:CategoryArchiveLink$>"<mt:IfNonEmpty tag="mt:CategoryDescription"> title="<$mt:CategoryDescription$>"</mt:IfNonEmpty>><$mt:CategoryLabel$> (<$mt:CategoryCount$>)</a>
        <mt:Else>
            <li class="widget-list-item"><$mt:CategoryLabel$>
        </mt:IfNonZero>
        <$mt:SubCatsRecurse$>
            </li>
        <mt:SubCatIsLast>
        </ul>
        </mt:SubCatIsLast>
          
</mt:If>

    </mt:TopLevelCategories>
    </div>
</div>
</mt:IfArchiveTypeEnabled>


It's good?

Ciao

raffaele
Raffaele
Or change this


CODE
<!—Codice per filtro categorie ->
<mt:SetVar name="IncludeCategory" value="false" />
<mt:IfCategory name="Cultura">
<mt:SetVar name="IncludeCategory" value="Cultura" />
</mt:IfCategory>
<mt:IfCategory name="Politica">
<mt:SetVar name="IncludeCategory" value="Politica" />
</mt:IfCategory>

<mt:If name="IncludeCategory" like="(Cultura|Politica)">


with

CODE
<mt:SetVarBlock name="IncludeCategory"><$MTCategoryLabel$></mt:SetVarBlock>
    <mt:If "$IncludeCategory" like="(Cultura|Teatro|Politica)">


ciao

raffaele
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-2010 Invision Power Services, Inc.