Code snippet for noindexing several archive folders
Hi Everybody,
i´m working on a archiving strategy for our community at the moment. As descibed in the how to article I have to ad a noindex Tag to the read only archiv named "Test-Archive" board I created.
For this I use this code and it works:
<#if coreNode.id == "Test_Archive">
<meta name="robots" content="noindex,follow">
</#if>
What should the code look like to use two or more archive folders?
I tried this code but unfortunately it doesn´t work:
<#if coreNode.id == "Test_Archive", "Test_Archive2">
<meta name="robots" content="noindex,follow">
</#if>
Could someone please help me?
Thanks
Marko
Below is updated code.
<#if coreNode.id == "Test_Archive" || coreNode.id == "Test_Archive2"> <meta name="robots" content="noindex,follow"> </#if>
Yes, you can replace my old code with this one.
e.g for 12 categories//Assign all the categories id below.
<#assign catIDs = ["Test_Archive2","Test_Archive", "Test_Archive3", "Test_Archive4", "and so on.."] /> <#if catIDs?seq_contains(coreNode.id)> <meta name="robots" content="noindex,follow"> </#if>In above example you just need to update in catIDs variable, the condition will be same.