EntryClassLabel

Because pages and entries have so much in common, it can be difficult to differentiate between the two. In one example of how this challenge manifests itself is in search results. By default Movable Type will return search results for Pages and Entries.

But what if you want your search results to style pages differently then entries? This template tag will allow you to do that, as the following example illustrates.

Example

<MTSearchResults>
<div class="search-results-container">
    </MTBlogResultHeader>
<mt:SetVarBlock name="type"><mt:EntryClassLabel></mt:SetVarBlock>
<mt:If name="$type" eq="Page">
<$MTInclude module="Page Summary"$>
<mt:Else>
<$MTInclude module="Entry Summary"$>
</mt:If>
    <MTBlogResultFooter>
</div>
    </MTBlogResultFooter>
</MTSearchResults>
This page was last updated on 2007-12-03, 15:47.  

Leave a note