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.
Options

Add Content Right After Body And "before" Content (before) pocket

AdrianAdrian Wandering SpiritMontreal MVP
edited May 2013 in Vanilla 2.0 - 2.8

Hi,

I love Pockets, but I am stumped at how I can add a 728x90 banner just below the Body, and above the Content (before) Pocket. Ultimately the banner should be just below the nav bar. Any hints or tips welcome :)

Comments

  • Options
    businessdadbusinessdad Stealth contributor MVP
    edited May 2013

    I know it's probably a stupid question, but why is Content (before) not the right place? From the screenshot, I imagine it would look as you expect.

  • Options
    hgtonighthgtonight ∞ · New Moderator
    edited May 2013
    Base_BeforeRenderAsset_Handler($Sender) {
      //check for content asset in sender var
    }
    

    You could also modify your template file to include the banner area.

    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.

  • Options
    peregrineperegrine MVP
    edited May 2013

    never mind. misread your question - thought you wanted it below discussiontabs.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    @businessdad said:
    I know it's probably a stupid question, but why is Content (before) not the right place? From the screenshot, I imagine it would look as you expect.

    looks like the place to me too!

    if I put this for example in the content beforepocket.

    <img id="myimage" src ="http://localhost/vanilla/bannertest.png">
    

    it puts it in the spot - if you really need to move it up a dom element
    for some unknown reason.
    you could use jquery

    if you are concerned that the banner interferes with panel on right - you could drop the panel with padding:top by 90 px.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    AdrianAdrian Wandering Spirit Montreal MVP

    @peregrine, I guess that would be the best bet. I was hoping there was a way to create a pocket called "bannerhead", or something. You are right about the panel on right being the issue. I need a 728x90 banner. The 468 fits fine. I don't want to hardcode though, I am using using pockets, as it allows me to turn the banner off and on as needed.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited May 2013

    I think the space you want to put that falls under Head so if you choose Head as the spot it should output it under the menu.

    If the menu comes out after it,you can switch that in the theme master or maybe add another function to render after menu, or maybe add Menu as a $Location in the array of the class.pockets.plugin

    public $Locations = array(
          'Content' => array('Name' => 'Content'),
          'Panel' => array('Name' => 'Panel'),
          'BetweenDiscussions' => array('Name' => 'Between Discussions', 'Wrap' => array('', '')),
          'BetweenComments' => array('Name' => 'Between Comments', 'Wrap' => array('', '')),
          'Head' => array('Name' => 'Head'),
          'Foot' => array('Name' => 'Foot'));
    

    I would just create an html div in my master in the area before the menu div.
    div class="BannerImage"

    < div >< img class="BannerImage>< /img >

    the css

    div.BannerImage{
    position:relative;
    top:60px;
    margin:0 auto;
    height:90px;
    width:728px;
    }

    img.BannerImage{
    height:90px;
    width:728px;
    border-radius:2px;
    }

    You could also add a transparent banner logo in the dashboard the size you want and use css to add the image as a background of the clear one

  • Options
    AdrianAdrian Wandering Spirit Montreal MVP
    edited June 2013

    @vrijvlinder thanks for the tip. I just wanted to follow up with how I solved thanks to your help. I added a new location called "HeaderAd" to the class.pockets.plugin, then in my theme, I created a div called "HeaderAd"

    <div id="HeaderAd">
    <?php $this->RenderAsset('HeaderAd'); ?>
     </div>
    

    And then I was able to use the pocket as I needed. Thanks again for pointing me in the right direction.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Awesome , I don't think there is anything that can't be done in Vanilla, just have to find the way :)

Sign In or Register to comment.