Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Have a pocket showing only on home page

This discussion is related to the Pockets addon.

Hi
I am adding meta tags with the pockets plugin. But i only want the pocket to att content on the home page.
Can this be done?

Tagged:

Comments

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited November 2012

    Two ways off the top of my head: Hide the Pocket using CSS on all other pages but the homepage or add a custom Pocket to your homepage using Smarty (applies to 2.1 and not 2.0):

    {if InSection("CategoryList")}
        {pocket name="Homepage"}
    {/if}
    

    I usually use the "All Categories" section as my homepage which is why I used CategoryList in the conditional.

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • @Kasper - can you expand on this please. Where would the code as described go? What is Smarty?

    Cheers

  • hgtonighthgtonight ∞ · New Moderator

    @demsley That would go in your themes default.master.tpl file.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    UnderDogdemsley
  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited November 2013

    The easiest way to control where the pockets show is by giving them an id or a class . This way you can allow one and not the others depending on where you want it to show.The editor is not working for me atm so remove spaces between < > if you copy any of it.

    example:
    
    this is what you would add in the pockets panel where you add the content.
    
    < div class="PocketA" >your content< /div >
    
    then use css in the custom.css file where you don't want it to show, each body is a page
    
    body.Profile .PocketA,body.Vanilla.Categories .PocketA {
    display:none;
    }
    hgtonightperegrine
Sign In or Register to comment.