Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Second Logo in header / Correct positioning / CSS

    Zen V1.5.5f using a custom template built with the standard Responsive Classic Template.

    I'm trying to add a second logo to my header but I'm stuck on getting the positioning to work correctly.

    The code in my tpl_header.php for the second logo is as follows:
    PHP Code:
    <!--bof branding display-->
    <div id="logoWrapper" class="group onerow-fluid">
        <div id="logo"><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">' zen_image($template->get_template_dir(HEADER_LOGO_IMAGEDIR_WS_TEMPLATE$current_page_base,'images'). '/' HEADER_LOGO_IMAGEHEADER_ALT_TEXTHEADER_LOGO_WIDTHHEADER_LOGO_HEIGHT) . '</a>'?>
        <div id="logoRight"><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">' zen_image($template->get_template_dir(HEADER_LOGORIGHT_IMAGEDIR_WS_TEMPLATE$current_page_base,'images'). '/' HEADER_LOGORIGHT_IMAGEHEADER_ALT_TEXTHEADER_LOGORIGHT_WIDTHHEADER_LOGORIGHT_HEIGHT) . '</a>'?>
    <?php 
    if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2))) { ?>
        <div id="taglineWrapper">
    <?php
      
    if (HEADER_SALES_TEXT != '') {
    ?>
          <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
    <?php
      
    }
    ?>
    <?php
      
    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2)) {
        if (
    $banner->RecordCount() > 0) {
    ?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static'$banner);?></div>
    <?php
        
    }
      }
    ?>
      </div>
    <?php // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
      </div>
      </div>
    </div>

    <!--eof branding display-->
    First I assume I got this right? I did this by reading old threads but they were based on 1.3 code. Secondly how do I get the second logo (logoRight) positioned on the far right of my header so I have the default logo left and the new one right.

    As a starting point I tried the following but how do I extend this to force it far right and not just right of my default logo?
    Code:
    #logoRight {float:right;}
    I can move it by adding margin-left settings but I assume this then messes up the responsive features and the logo will shift down when the browser window is too small.

    Any pointers please.

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: Second Logo in header / Correct positioning / CSS

    a link to your site with the logo up would be helpful....
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #3
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Re: Second Logo in header / Correct positioning / CSS

    Understood. Was hoping the code above was enough as the site is running locally during the build. The last time I posted a link to my test site Google went and indexed that and started directing customers there.

    I'll get it online and post a link if that's what it takes though as I'm still struggling.

    Was just experimenting with the following but from what I was reading I think the main div wrapper then needs to be relative. Also logo and logoRight are then out of line. Lastly when you reduce the window size they overlap as they haven't been told to wrap.
    Code:
    #logoRight {right: 0; top: 0; position: absolute;}

  4. #4
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: Second Logo in header / Correct positioning / CSS

    Try this (moved logo-right div), and add the following css to your stylesheet, of course you then need to tweak it to your needs

    #logoRight {
    float: right;
    }

    PHP Code:
    <!--bof branding display-->
    <div id="logoWrapper" class="group onerow-fluid">
        <div id="logo"><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">' zen_image($template->get_template_dir(HEADER_LOGO_IMAGEDIR_WS_TEMPLATE$current_page_base,'images'). '/' HEADER_LOGO_IMAGEHEADER_ALT_TEXTHEADER_LOGO_WIDTHHEADER_LOGO_HEIGHT) . '</a>'?>
    <?php 
    if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2))) { ?>
        <div id="taglineWrapper">
    <?php
      
    if (HEADER_SALES_TEXT != '') {
    ?>
          <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
    <?php
      
    }
    ?>
    <?php
      
    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2)) {
        if (
    $banner->RecordCount() > 0) {
    ?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static'$banner);?></div>
    <?php
        
    }
      }
    ?>
      </div>
    <?php // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
      
      </div>

    <div id="logoRight">
    <?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">' zen_image($template->get_template_dir(HEADER_LOGORIGHT_IMAGEDIR_WS_TEMPLATE$current_page_base,'images'). '/' HEADER_LOGORIGHT_IMAGEHEADER_ALT_TEXTHEADER_LOGORIGHT_WIDTHHEADER_LOGORIGHT_HEIGHT) . '</a>'?>
    </div>

    </div>

    <!--eof branding display-->

  5. #5
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Re: Second Logo in header / Correct positioning / CSS



    Sooo easy when you just know how. I couldn't work out how to split the div and where to place it as I think my logoRight was within the div for logo?

    Thank you so much for the help. All sorted.

    For anyone else trying the same the only modification I made was to the css. This matched the #logo div and lined the logos up with eachother.

    Code:
    #logoRight {float: right;margin:10px 0;}

  6. #6
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: Second Logo in header / Correct positioning / CSS

    Welcome, glad I could help.

  7. #7
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,137
    Plugin Contributions
    11

    Default Re: Second Logo in header / Correct positioning / CSS

    Quote Originally Posted by Brent View Post
    Understood. Was hoping the code above was enough as the site is running locally during the build. The last time I posted a link to my test site Google went and indexed that and started directing customers there.
    So often we fail to read all the instructions. At the bottom of the posting tips is
    *NOTE: Search engines index this Zen Cart® support site very quickly. Posting your URL will cause your site and your post to show up in search engines. If you want to prevent that, put spaces between each letter of the domain name in your URL.

 

 

Similar Threads

  1. What is the correct code to center my header logo...
    By sfklaas in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Feb 2009, 06:00 PM
  2. Positioning images in the header with CSS
    By craig806 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Jun 2007, 05:28 AM
  3. Positioning images in the header with CSS
    By craig806 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Jun 2007, 02:16 AM
  4. How do I add a second logo to the header?
    By gaukler in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 25 Nov 2006, 05:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR