Help - Search - Members - Calendar
Full Version: Using Value Of Var N Mt:ifcategory
Movable Type Community Forum > Using Movable Type > Categories and Entry Tags
Apfel007
Need Heeelp!!
Why i not get the "right" of the If system? Is the "MTGetVar" not working with MT:IfCategory?

Cheers Kai


CODE
<MTSetVarBlock name="ThisBlog">
<$MTBlogName$>
</MTSetVarBlock>
<MTGetVar name="ThisBlog">
<MTVar name="ThisBlog">
<MTOtherBlog include_blogs="12">
<div class="Link List widget">
<h3 class="widget-header">Links</h3>
<div class="widget-content">
<MTCategories>
<mt:IfCategory name="<MTGetVar name="ThisBlog">">
<!-- do something -->
<"right">
<ul>
<MTEntries sort_by="title" sort_order="ascend">
<li class="widget-list-item">
<img src="<$MTStaticWebPath$>images/list_icon.gif" width="4" height="7" alt="" class="list_w_image" /><a href="<$MTEntryBody convert_breaks="0"$>" target="_blank" <MTIfNonEmpty tag="EntryMore">title="<$MTEntryExcerpt$>"</MTIfNonEmpty>><$MTEntryTitle$></a><MTIfNonEmpty tag="EntryMore"><span><$MTEntryMore convert_breaks="0"$></span></MTIfNonEmpty>
</li>
</MTEntries>
</ul>
<mt:else>
<"fasle">
<MTEntries sort_by="title" sort_order="ascend">

</MTEntries>
</ul>
<!-- do something else -->
</mt:IfCategory>
</MTCategories>
</div></div>
</MTOtherBlog>
Apfel007
Hi threre!
Is no body there who has an answer, why this is not working?

<MTIfCategory label="<$MTGetVar name="ThisBlog"$>">

Is it not possible to give "label" a value from var?

Cheers Kai
danwolfgang
Without looking to closely or trying it, do you need to strip line feeds from the ThisBlog var?
Apfel007
QUOTE (danwolfgang @ Jan 8 2008, 12:36 AM) *
Without looking to closely or trying it, do you need to strip line feeds from the ThisBlog var?


Hi wolfgang,

ok this strip.. make sense, but helps not .. thanx :-(
I think there is something wrong with MTGetVar huh.gif? to get the value of GetVar into "name"



CODE
<MTSetVarBlock name="ThisBlog" strip_linefeeds="1">
<$MTBlogName$>
</MTSetVarBlock>
.....
<mt:IfCategory name="<MTGetVar name="ThisBlog">">

....

sarah
Try:

CODE
<MTSetVarBlock name="ThisBlog"><$MTBlogName$></MTSetVarBlock>
<MTIfCategory label="$ThisBlog">
<!-- do something -->
</MTIfCategory>
Milohoss
Managed to make it work on the Category Archives like this:


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>



But the %(#*( individual archives is another universe, any thoughts?
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.