Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    May 2007
    Posts
    38
    Plugin Contributions
    0

    Default where to add a new 'define' - Text for the Logo?

    Sorry for asking, but I haven't found anything on this so far...

    I would like to add a special css-class to my header logo. So as recommended I copied the header.php from /includes/languages/english/classic to my newly created override-file in /includes/languages/english/mytemplate and added a new define like this

    define('HEADER_LOGO_IMAGE', 'RR-Logo.jpg');
    define('HEADER_LOGO_CLASS', ' class="logo"');

    assuming that ZC will add that to the tpl-header.php like the other ones:

    <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT, HEADER_LOGO_CLASS). '</a>'; ?>

    But this doesn't do the trick?

    What do I have to change to get the additional class-information into my <img>-tag?

    Thanks in advance!

    Miriam

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: where to add a new 'define' - Text for the Logo?

    What are you trying to do with the logo using the CSS?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    May 2007
    Posts
    38
    Plugin Contributions
    0

    Default Re: where to add a new 'define' - Text for the Logo?

    I've added some margin/padding to the image, that's all. I created a "sidebar" which contains The Logo, some text and the ZC left-sideboxes, and everything has its special positioning, so there is a class for the image to manage the exact position in relation with the other stuff...

    But to use these define-texts would be usefull for other things too...

    Want do you think about it?

    Regards, Miriam

  4. #4
    Join Date
    May 2007
    Posts
    38
    Plugin Contributions
    0

    Default Re: where to add a new 'define' - Text for the Logo?

    What (sic!) do you think...

    nasty typo

    I looked for the zen_image and found its occurence in various files. Am I right that my css-class has to be assigned as an additional variable in the general function like the $alt for alt-text and $width for the image-width?

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: where to add a new 'define' - Text for the Logo?

    The easiest way to handle this would be to wrap the link in a <span class="sidebarLogo"> </span>.
    You're adding new code anyway; the span would be simple and effective... of course, getting proficient at using the specialized zen functions is a good thing.

    See any interior page of my site for another example of sidebar logo.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: where to add a new 'define' - Text for the Logo?

    Another point - if you are using this inside a div (say id="sideLogo") with text, even links, but no other images, you can style

    #sideLogo a img {}

    to affect only that image within the div.
    No further tags required.

  7. #7
    Join Date
    May 2007
    Posts
    38
    Plugin Contributions
    0

    Default Re: where to add a new 'define' - Text for the Logo?

    So sorry, but I thought over it already... You seem to solve this always by editing the CSS, do you? But there will be some more images in that place...

    Of course I could add a class to those images, in order to keep them in place, despite of the text-align of the complete sidebar...

    But it would be correct to assign the class to the logo image, which has to stand out of the rest...

    And it should not be too hard to achieve that little class-addition? Meanwhile I found in Smarty and image function something like extra parameters? Adding the class in the way I did above results in either text (<img>class="logo"</a>) oder in adding the class="logo" to the Alt_Text of the image itself. I did not expect this to be so difficult...

    Best regards, Miriam

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: where to add a new 'define' - Text for the Logo?

    I was looking at zen_image just the other day, and it has already a place for things like class to be added ($parameters), after width and height.

    function zen_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

    I believe it needs these in the correct order to recognize what each value is supposed to represent, so to get $parameters you have to get past $width and $height. Adding extra commas may do it since there are default values.

    zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT,,, HEADER_LOGO_CLASS).

  9. #9
    Join Date
    May 2007
    Posts
    38
    Plugin Contributions
    0

    Default Re: where to add a new 'define' - Text for the Logo?

    YES!

    Adding commas did not work, throwed php-error instead, but inserting all missing vars made it:

    PHP Code:
    <?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_IMAGE,HEADER_ALT_TEXT,HEADER_LOGO_WIDTHHEADER_LOGO_HEIGHT,HEADER_LOGO_CLASS). '</a>'?>
    results in:

    HTML Code:
    <!--bof-branding display-->
        <a href="http://localhost/zen/"><img src="includes/templates/RR-Template/images/RR-Logo.jpg" alt="Rabe &amp; Rose" 
    title=" Rabe &amp; Rose " 
    width="164px" height="149px" class="logo" /></a>
    Hah! That's nice! Thank you very much!


    Regards, Miriam

    This also means, that you can add anything you like to the image-tag... I will check where $parameter is sitting as well to extend existing template issues - That's probably worth mentioning in the FAQ section, gjh42!
    Last edited by miriam_t; 20 May 2007 at 07:19 PM. Reason: Addition.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: where to add a new 'define' - Text for the Logo?

    Hmm... so it needs a value for each piece, not just a comma to skip it.
    If you don't want to assign a constant to the width & height but let the image determine it, would it work to put blanks in?
    PHP Code:
    zen_image($src$alt' '' '$parameters) { 

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Where can I add/subtract from the TITLE of the box for New Products
    By driven13 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Jun 2010, 04:11 PM
  2. Add text to the right of logo
    By conmac863 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 5 Feb 2009, 07:00 PM
  3. Where can I find a larger size copy of the new ZenCart logo?
    By ronpeled in forum General Questions
    Replies: 0
    Last Post: 23 Sep 2008, 01:29 AM
  4. Where's the Add to Cart: text in tpl_product_info_display.php?
    By datatv in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Jun 2008, 02:24 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