<$mt:TagSearchLink$>

A variable tag that outputs a link to a tag search for the entry tag in context. The tag context is created by either an EntryTags or a Tags block.

Like all variable tags, you can apply any of the supported global modifiers to TagSearchLink to do further transformations.

The example below shows each tag in a cloud tag linked to a search for other entries with that tag assigned. It can just as easily be used to link entry tags within an EntryTags loop

    <h1>Tag cloud</h1>
    <div id="tagcloud">
        <mt:Tags>
            <h<$mt:TagRank$>>
                <a href="<$mt:TagSearchLink$>"><$mt:TagName$></a>
            </h<$mt:TagRank$>>
        </mt:Tags>
    </div>

The search link will look something like:

    http://example.com/mt/mt-search.cgi?blog_id=1&tag=politics

Using Apache rewriting, the search URL can be cleaned up to look something like:

    http://example.com/tag/politics

A URL like this would have to be built like this:

    <$mt:BlogURL$>tag/<$mt:TagName normalize="1"$>

And of course, you would have to create the .htaccess rules to translate this into a request to mt-search.cgi.

This page was last updated on 2012-10-29, 08:39.