Re: checking for sorted pages

Tim Stalker <[email protected]>
Newsgroups gmane.comp.cms.xaraya.user
Message-ID <[email protected]>
>
> Tim Stalker <[email protected]> wrote in message   
> <mailman.3782.1208377906.5462.xaraya_user-gn8pmO+6nszQT0dZR+AlfA@public.gmane.org>
>
>> I'm wondering if anyone can help me think of a way to add a noindex
>> metatag to pages with the sort=hits, title, ratings, etc. in the url.
>> I don't need these pages in any search engine index. So far I've
>> thought to use xarservergetcurrenturl and then compare that value to
>> something containing the sort parameters. I don't think Xaraya has a
>> "like" operator in the xar:if conditionals, unless I'm mistaken. It
>> would be cool to test the current page's url against some thing like
>> "if current url contains "sort=hits", then add the meta tag." To do
>> this from the theme's header block would be ideal, but I can't figure
>> out how to check to see if a sorted page can have the tag added to it.
>> Any help would be most appreciated.
>> --
>> Tim Stalker
>> <a href="http://www.wiseheat.com">test</a>
>
> You could cache the nofollow from within your display template
> <xar:if condition="!empty($sort)">
>     <xar:set name="dummy">#xarVarSetCached('Blocks.mycache',   
> 'nofollow',1)#</xar:set>
> </xar:if>
>
> then in the meta block template add
>
> <xar:if condition="xarVarIsCached('Blocks.mycache', 'nofollow')">
>     <xar:set name="$nofollow">#xarVarGetCached('Blocks.mycache',   
> 'nofollow')#</xar:set>
> <xar:else />
>     <xar:set name="$nofollow">'0'</xar:set>
> </xar:if>
> <xar:if condition="$nofollow">
>    <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
> </xar:if>
>
> haven't tried it, but it should work.
>


In the last condition do you mean to use code

<xar:if condition="nofollow eq '1'">

I'll give this a shot. This looks good, and thanks.


-- 
Tim Stalker
<a href="http://www.word-builder.com">test</a>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.