Custom Header

Discussion in 'Templates customization' started by vinca, Oct 11, 2010.

  1. vinca

    vinca New Member

    Joined:
    Sep 16, 2010
    Messages:
    10
    Hi,

    I am trying to follow your instructions for making my custom header but something is not working. Does anyone have a sample of what the header.html file might look like? The instructions say to copy css info from the amember header.html template but I don't see any css on that file only this:

    {php}

    echo amember_get_header($this->_tpl_vars);

    {/php}

    Thank you!!!
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    I guess you use PRO 3.2.2 beta version?
    For that version you should edit /amember/templates/layout.html file, it have both header and footer in one place.
  3. vinca

    vinca New Member

    Joined:
    Sep 16, 2010
    Messages:
    10
    Thank you, I found the layout file. I see this in the head section:
    {php}echo amember_get_header_code();{/php}

    What does that mean?
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    By default this code just insert links to aMember styles.
  5. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    I don't understand how this works. We now have layout.html and header/footer.html.

    header.html and footer.html are still called from member.html
    So layout.html is used for plugins or ... ?

    They both call echo amember_get_header, layout passes no variables, header passes $this->_tpl_vars
    What exactly is passed? If I edit header.html and just add some text on top I mess up the layout because the text is added before the DOCTYPE tag...

    I'm lost here :(
  6. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    @erwinvdb: if you are running > 3.2.2 version of aMember you should just use the layout.html
  7. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    I finally found out how it works! :D

    Ok, so for upgrading I moved the stuff from my previous (3.1.9) header and footer templates to layout.html.

    As of version 3.2.2 header.html and footer.html calls amember_get_header / amember_get_footer that in turn call amember_get_header_footer, that calls layout.html.
    In layout.html amember_get_header_code is called and that calls amember_get_header_code_standard what inserts the two (three if site.css is available) css links.

    These functions (as well as the google analytics code) can be found in plugins.inc.php

    Can someone from amember staff confirm if this is correct?

    Thanks,
    Erwin
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes this is correct.

Share This Page