Thread: Header tagline

Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Header tagline

    On a fresh install of 1.3.9g, with the template widened to 100%, the Header tagline Sales Message Goes Here stays to the rightish on the page. I'm guessing this is because it's being centered between the logo.gif (over on the left) and the right edge of the template? Or is it set to stay put regardless of the width of the template? I looked for a positioning element in the stylesheet and in header.php but didn't see anything.

    I would like to modify the tagline, center it on the page, maybe change color, etc. Is this an easy thing to do? No help on these particular issues in Tutorial
    https://www.zen-cart.com/tutorials/i...hp?article=127

    thank you!

    (oh, by the way, the Tutorial for widening the template for version 1.3.x says to change 100% to a pixel value. Shouldn't those instructions be the other way around, i.e., change 750px to 100%?) https://www.zen-cart.com/tutorials/index.php?article=46

  2. #2
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Header tagline

    Well, I did find tagline attributes on about line 423 in the stylesheet, and it appears that the text is set to wrap (rather than ignore) on the logo that is to the left of it, so center aligning puts the tagline somewhat rightish of page center. Maybe use some non-breaking spaces in front of the text, w/ left-alignment, to get it about center on the page? Or, remove the picture element on the logo that forces text to wrap on it? Pretty minor stuff, I know, but Zen Cart is pretty cool and I'm enjoying getting familiar with the files that make things happen! Thanks again.

  3. #3
    Join Date
    Sep 2010
    Posts
    263
    Plugin Contributions
    0

    Default Re: Header tagline

    Finlander any luck with this yet ? I'm having same problem with centering of the tagline text. i.e. its slightly right of centre at present.

  4. #4
    Join Date
    Sep 2010
    Posts
    263
    Plugin Contributions
    0

    Default Re: Header tagline

    I think the solution might lie in the two files.

    header.php
    tpl_header.php

    I noticed the you can add extra text in the TAGLINE heading entry in header.php and it gradually centres the text in the browser. If you can work out how to pad extra spaces in PHP and add them to the tpl_header.php tagline reference, you might get the tagline to centre. The output possibly to change is;

    <div id="tagline"><?php echo HEADER_SALES_TEXT;?> </div>

    I think we need to be able to add padded spaces to the end of this text.

    I'm still looking into this, but found something interesting here. It talks about how the web browser treats blank space and how you can use a different method to output padded spaces in the browser either in PHP or via css. I'm thinking PHP just for that one line that displays the tagline might be the way.

    You best use template overrides though, by copying the default tpl_header.php to your custom template area. i.e. copy

    From

    /includes/templates/template_default/common/tpl_header.php

    To

    /includes/templates/mytemplate/common/tpl_header.php

    mytemplate is whatever name your template folder is.

    Talk about How do you echo a long space

    http://bytes.com/topic/php/answers/6...cho-long-space

    I have to get some sleep, so I will hand the batton over to you to investigate. I assume you're in Finland, so your day is my night here in Australia. Will discuss tomorrow.

    007

  5. #5
    Join Date
    Sep 2010
    Posts
    263
    Plugin Contributions
    0

    Default Re: Header tagline

    I've been experimenting with this;

    <div id="tagline"><?php echo HEADER_SALES_TEXT;?> <?php echo '...';?> </div>

    At present still blank spaces are truncated by the web browser, so I'm using ... for now.

  6. #6
    Join Date
    Sep 2010
    Posts
    263
    Plugin Contributions
    0

    Have a Drink Re: Header tagline

    YAY, I think I've got it working. I Googled: printing &nbsp php

    Try this below for your tpl_header.php template override;

    <div id="tagline"><?php echo HEADER_SALES_TEXT;?> <?php print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";?> </div>

    Use as many ;&nbsp as you need to centre your Tagline.

    ref; Learning PHP - Part 1: A Gentle Introduction

    http://www.communitymx.com/content/a...ge=2&cid=D5084

  7. #7
    Join Date
    Sep 2010
    Posts
    263
    Plugin Contributions
    0

    Default Re: Header tagline

    Oh well, it looks like we have found two solutions. Your's looks a bit more elegant, as it conforms to css standard, without changing the PHP code, but I am at least using the template override method.

    Will look at your approach tomorrow. Time to sleep !

  8. #8
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: Header tagline

    Hi 007,

    Looks as though are digging into things!

    I think you are right that adding padding to the end of the text would accomplish the look that you want, by pushing the visible text to the left, but that may not be the best way to handle it.

    The text is currently right of center because it's centering between the logo and the right side of the template, rather than simply centering between the two sides of the template. Adding spaces to the end of the text would force the visible text to the left, but if the tagline is two lines or more, then text wrapping would defeat that method. BTW, though, if you wanted to use this method, wouldn't non-breaking space characters be far easier than coding for it? Just use '&nbsp;' (w/o quotes) and the browsers will respect however many you want to use.

    The method that I finally came up with is to left-align the text, which shoves it up next to the right edge of the logo, and then add a padding statement for the logo's right edge to push the text back to the right until it is close to the spot you want.

    I am currently using these values in my code. I added in the logo definition in the css just under another piece of existing code that sets floating for the logo.

    #tagline {
    color: #000000;
    font-size: 1.5em;
    text-align: left;
    vertical-align: middle;
    padding-top: .6em;
    }


    #logo {
    padding-right: 2em;
    }

    And this is what renders:
    vintage-adventures.com

    good luck w/ things!

 

 

Similar Threads

  1. How do I remove tagline from header?
    By rakebackgeek in forum General Questions
    Replies: 1
    Last Post: 10 Jul 2012, 12:13 PM
  2. Tagline is sitting under the header - why?
    By GreyWolfWebDesign in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Feb 2010, 03:49 PM
  3. Tagline / Header Issues
    By dmiller226 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 21 Feb 2009, 05:34 AM
  4. Header/tagline white space
    By immortalitea in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Oct 2008, 04:56 AM
  5. Move Header Tagline to Home - Login Cell
    By metmax in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 Feb 2007, 05:12 AM

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