Page 26 of 227 FirstFirst ... 1624252627283676126 ... LastLast
Results 251 to 260 of 2267
  1. #251
    Join Date
    Feb 2007
    Posts
    819
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Anyone know which piece of code controls how the links are listed? I want to change it from this:
    HEADING
    link link link etc.

    To this:
    HEADING
    link
    link
    link

    Thanks.

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

    Default Re: Categories Dressing

    This is controlled by the display: block; or display: list-item; properties in your stylesheet. Cat Dressing by default does this, so you must have deleted some code lines or otherwise are not applying Cat Dressing as designed.

  3. #253
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Glenn, I adapted your Categories Dressing code for using an image for each of my EZPages link if one is available. I didn't make it very robust, just put the code in that I wanted. You made it so easy for me to use images for sidebox titles using the Image Titles mod that I decided to apply the same concept to my EZPages links. In case you ever choose to expand your Categories Dressing mod to include the EZ Pages sidebox, here's the code from my tpl_ezpages.php (it's the full code from 1.3.8a):

    PHP Code:
    <?php
    /**
     * Side Box Template
     *        05/28/08    Modifications adapted from Categories Dressing mod to post images instead of the
     *                            page name if the *.gif image is available. Also defines CSS id "ezLink" concatenated
     *                            with the same name as the EZ Link with blanks converted to underscores for the anchor tag
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_ezpages.php 2982 2006-02-07 07:56:41Z birdbrain $
     */
     
        
    $content "";
        
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">';
        
    $content  .= "\n" '<ul style="margin: 0; padding: 0; list-style-type: none;">' "\n";
        for (
    $i=1$n=sizeof($var_linksList); $i<=$n$i++) { 
            
    $ez_name_display $var_linksList[$i]['name'];
              
    $assoc_image_file 'ezimg_' strtr($ez_name_display,' ','_') . '.gif'/* replace blanks in name with underscore */
              
    if( file_exists(DIR_WS_TEMPLATE_IMAGES $assoc_image_file) ) {
                  
    /* code has determined that image file with appropriate name exists, so plug it in */
                  
    $ez_name_display zen_image(DIR_WS_TEMPLATE_IMAGES $assoc_image_file''''''' title="Follow link to ' $ez_name_display ' "');
              }
            
    $content .= '<li><a href="' $var_linksList[$i]['link'] . '">' $ez_name_display '</a></li>' "\n" ;
        } 
    // end FOR loop
        
    $content  .= '</ul>' "\n";
        
    $content .= '</div>';
    ?>
    Hope this is helpful, Karen

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

    Default Re: Categories Dressing

    Good work! Thanks for posting this so others can use it.
    At a glance, it looks pretty complete to me. "Robust" doesn't mean having a lot of different features, just making the included features work in all circumstances.
    Last edited by gjh42; 28 May 2008 at 09:12 PM.

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

    Default Re: Categories Dressing

    It might be a good idea to post this in a new thread titled something like "Images for EZ-Page Links" so it will be easier for people to find.

  6. #256
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    I don't actually know how to move a post! I also just realized that the code I posted doesn't have the CSS tag code in it, even though the header comments says it does. I'll have to edit that part of the comments out before I re-post. I did have the code in there but decided to pull it out - there are already so many different ways of changing the css for the ezpages sidebox that I decided it was overkill.

    I'll dup the post at your suggestion.
    Karen

  7. #257
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Didn't know appropriate place to post it, but I followed your advice, Glenn, and posted it here:

    http://www.zen-cart.com/forum/showthread.php?t=98946

    Thanks for giving me the code in both mods to make my work so much easier!! Karen

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

    Default Re: Categories Dressing

    I just noticed a typo in one line:
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">'
    The closing ) is misplaced.
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id) . 'Content" class="sideBoxContent">'

  9. #259
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Categories Dressing

    Quote Originally Posted by gjh42 View Post
    I just noticed a typo in one line:
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">'
    The closing ) is misplaced.
    PHP Code:
        $content .= '<div id="' str_replace('_''-'$box_id) . 'Content" class="sideBoxContent">'
    Ironically, Glenn, I didn't change this code, it is still original from 1.3.8a. At first glance, I'd have to agree that it looks like a bug in the original code, though not one that I injected. Since I'm doing my development on my laptop and I'm on my desktop right now, I don't have any of my code in front of me, although I am looking at a vanilla unzipped version of 1.3.8a and the apparent oops is in there.

    ... looking more carefully ...

    Actually, the more I look at it, I don't think its a bug at all. If you look carefully, they are building the name of the div id, but they are replacing the underscores with dashes. The string 'Content' gets concatenated on to the $box_id as part of the name of the id (like sideBoxContent is the class name - notice the Content tacked onto the end of the name). If the code was changed the way you suggested, there would be an extra keyword 'Content' in the <div> declaration between the id and class attributes. I'm not sure if that would flag an error, but I'm pretty certain that 'Content' would be unrecognized.

    Does that makes sense to you?
    Karen

  10. #260
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Categories Dressing

    Actually either is fine and will generate the same result.

    The str_replace function here is simply replacing underlines with hyphens and including the result in the DIV ID. Since the string Content doesn't have any hyphens, it's unchanged. Whether it's therefore included in the ID by the str_replace or added afterwards makes no difference, the end result.

    Glenn's version is however, very slightly more efficient and would be the way that I would code it by default, since the code will execute a fraction of a millisecond quicker if the Content string is outside of the str_replace function as then it doesn't have to be checked to see if has any underscores.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 

Similar Threads

  1. categories dressing
    By fw541c in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 19 Nov 2010, 09:29 PM
  2. Categories Dressing
    By wotnow in forum Addon Sideboxes
    Replies: 10
    Last Post: 7 Apr 2010, 03:06 AM
  3. Categories Dressing issue
    By Maynards in forum Addon Sideboxes
    Replies: 0
    Last Post: 13 Mar 2010, 10:51 PM
  4. Categories Dressing
    By Maynards in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Mar 2010, 11:05 PM
  5. Categories Dressing
    By PGlad in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Aug 2007, 07:05 PM

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