Forum Discussion

housikrausi's avatar
7 years ago

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 ...
  • TariqHussain's avatar
    TariqHussain
    7 years ago

    housikrausi - 

     

    Below is updated code. 

     

    <#if coreNode.id == "Test_Archive" || coreNode.id == "Test_Archive2">
    <meta name="robots" content="noindex,follow">
    </#if> 
  • TariqHussain's avatar
    TariqHussain
    7 years ago

    housikrausi - 

     

    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.