Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jul 2007
    Posts
    61
    Plugin Contributions
    0

    Default Solution to use images for EZ-Pages links

    [FONT=Courier New]Adapted the link image code from Glenn Hebert's "Categories Dressing" mod to substitute the EZ Pages links text with an image if it is available. None of the other "Categories Dressing" features were adapted here, but they easily could be. I just didn't need them. [/FONT]

    [FONT=Courier New]If you have an image, it should be named ezimg_yourEZpageNameHere.gif[/FONT]
    [FONT=Courier New]where "yourEZpageNameHere" is substituted with the text that is in your EZ page link. If there are blanks in the name, replace the blanks with underscores when naming the image file. The image should exist in includes/templates/YOUR_TEMPLATE/images in order for the code to find it. If there is no appropriately named image found, the code will just put the text name that you defined just as the vanilla code does.[/FONT]

    [FONT=Courier New]Here's my override copy of the includes/templates/YOUR_TEMPLATE/sideboxes/tpl_ezpages.php file with the changes applied to 1.3.8a version.[/FONT]

    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. 
    *
    * @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>';
    ?>

    [FONT=Courier New]Hope this is helpful to someone![/FONT]
    [FONT=Courier New]Karen[/FONT]

  2. #2
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Solution to use images for EZ-Pages links

    Not tested your creation, but thanks for sharing

  3. #3
    Join Date
    Sep 2005
    Location
    The Internets
    Posts
    190
    Plugin Contributions
    0

    Default Re: Solution to use images for EZ-Pages links

    Very useful indeed!

    It's the little modifications like this that make Zen as great as it is.
    Make regular site and database backups!

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

    Default Re: Solution to use images for EZ-Pages links

    Pack it up and submit the mod.


  5. #5
    Join Date
    Mar 2009
    Location
    Cornelius, NC
    Posts
    334
    Plugin Contributions
    0

    Default Re: Solution to use images for EZ-Pages links

    anyone used this, or have something different?

    i have copied the code, and named/uploaded my images appropriately (from the best i can tell)... with no success...

    anyone?

    site is www.customk9design.com/catalogzen

    have placed image for the "About_Us" ezpage.

  6. #6
    Join Date
    Jan 2008
    Location
    Switzerland
    Posts
    38
    Plugin Contributions
    0

    Default Re: Solution to use images for EZ-Pages links

    I also tried this but it didn't work. Not sure why, the image just won't show up. Have been searching the forum through and through but with no luck on an answer. If anyone out there has a solution to this problem that would be great :)

  7. #7
    Join Date
    Mar 2009
    Location
    Cornelius, NC
    Posts
    334
    Plugin Contributions
    0

    Default Re: Solution to use images for EZ-Pages links

    Quote Originally Posted by tracey View Post
    I also tried this but it didn't work. Not sure why, the image just won't show up. Have been searching the forum through and through but with no luck on an answer. If anyone out there has a solution to this problem that would be great :)
    i am successfully adding images with links in my footer... im sure it would be the same in the header...

    i havent gotten back up to the header yet, so havent tried it myself. let me know if you want to give it a try, and we'll figure out some code... :)

  8. #8
    Join Date
    Mar 2009
    Location
    Cornelius, NC
    Posts
    334
    Plugin Contributions
    0

    Default Re: Solution to use images for EZ-Pages links

    ok, so i have a partial solution... (still working on the rest)
    it is working successfully in the header...
    in your tpl_header.php file (in your "your template"/common folder)

    try these changes...
    note the simple edition of the link, and image call, also deleted some of that line that the link replaced.

    the current bar is still showing, thats the next part for me to figure out, what needs to be deleted...

    <!--eof-header logo and navigation display-->

    <!--bof-optional categories tabs navigation display-->
    <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
    <!--eof-optional categories tabs navigation display-->

    <!--bof-header ezpage links-->
    <li><a href='http://customk9design.com/catalogzen/index.php?main_page=page&id=2'><img src="http://www.customk9design.com/catalogzen/includes/templates/darkness/images/about_us.gif" alt="About Us" /></a></li>
    <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
    <?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
    <?php } ?>
    <!--eof-header ezpage links-->
    </div>
    <?php } ?>
    Last edited by customk1; 28 Mar 2009 at 12:23 AM. Reason: (edited line wasnt showing in red)

  9. #9
    Join Date
    Mar 2009
    Location
    Cornelius, NC
    Posts
    334
    Plugin Contributions
    0

    Default Re: Solution to use images for EZ-Pages links

    ok simple answer to the duplicated toolbar, just go to zen cart admin, config/ezpages settings/ezpages display bar header--- set to zero...

    there is still a gap afterwards, but im sure thats just a br or div somewhere that can be easily taken out.

    check out the results here:
    www.customk9design.com/catalogzen

  10. #10
    Join Date
    Feb 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Solution to use images for EZ-Pages links

    Hello,

    Great idea here!

    I'm curious if we could get an example concerning the "ezimg_yourEZpageNameHere.gif" renaming. For instance, is this asking for link name, page title, etc.? I've tried it a couple of different ways without success so if anyone would share some enlightenment on this (as I am assuming this is also where others have run into problems) that would be awesome!

    Great work!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 27
    Last Post: 7 Dec 2011, 11:09 AM
  2. Images For General use
    By FredTheFifth in forum Basic Configuration
    Replies: 3
    Last Post: 7 Jul 2009, 09:28 PM
  3. have a question about main nav.. - can I use images for the links?
    By Pariseau in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 3 Apr 2008, 04:29 PM
  4. How to use images instead of text for header menu links
    By Jeevie in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Oct 2007, 04:41 PM
  5. How to use text links instead of images for buttons
    By goodevil in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Apr 2007, 07:40 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