Results 1 to 7 of 7
  1. #1
    Join Date
    May 2010
    Posts
    67
    Plugin Contributions
    0

    Default Commenting Out a Line in a Template

    Hello,

    I have very little knowledge of PHP and am having trouble commenting out the underlined code in the following code snippet:

    Code:
    <!--bof-branding display-->
    <div id="logoWrapper">
        <div id="logo"><?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) . '</a>'; ?>
        </div>
     <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
       <div id="taglineWrapper">
         
    	<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_AD_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' .HEADER_AD_IMAGE, HEADER_AD_TEXT) . '</a>'; ?>
        </div>
        <?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
    </div>
    <br class="clearBoth" />
    <!--eof-branding display-->
    Where do I put the "/*" and "*/"?

    Thanks,

    ojhernandez

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Commenting Out a Line in a Template

    Code:
    /*<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_AD_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' .HEADER_AD_IMAGE, HEADER_AD_TEXT) . '</a>'; ?>*/
    See above

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

    Default Re: Commenting Out a Line in a Template

    Better yet, instead of editing PHP files, set the define for HEADER_SALES_TEXT to '' (two single quotes, equalling null), and in admin set SHOW_BANNERS_GROUP_SET2 to blank.

  4. #4
    Join Date
    May 2010
    Posts
    67
    Plugin Contributions
    0

    Default Re: Commenting Out a Line in a Template

    Quote Originally Posted by kobra View Post
    Code:
    /*<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_AD_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' .HEADER_AD_IMAGE, HEADER_AD_TEXT) . '</a>'; ?>*/
    See above
    I thought that was how it was done so that was the first thing I tried.

    However it didn't work.

    I tried it again just to make sure I didn't make a mistake and it doesn't work.

    It actually displays the "/*" and "*/" in my header.

    Is there any other possible solution?

    Thanks,

    ojhernandez

  5. #5
    Join Date
    May 2010
    Posts
    67
    Plugin Contributions
    0

    Default Re: Commenting Out a Line in a Template

    I actually figured it out! I commented it out with "<!--" and "-->"

  6. #6
    Join Date
    May 2010
    Posts
    67
    Plugin Contributions
    0

    Default Re: Commenting Out a Line in a Template

    Quote Originally Posted by gjh42 View Post
    Better yet, instead of editing PHP files, set the define for HEADER_SALES_TEXT to '' (two single quotes, equalling null), and in admin set SHOW_BANNERS_GROUP_SET2 to blank.
    I'm sorry, I just saw your reply.

    How would I do that?

    Also, I'm confused as to what exactly this accomplishes or rather, how it is better than commenting it out.

    Could you please enlighten me?

    Thanks,

    ojhernandez

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

    Default Re: Commenting Out a Line in a Template

    Admin settings and language define files are intended to be customized by users, and edits/settings you make are kept in centralized locations. Every PHP template file or module file you edit needs to be checked against the changelog when you update your cart, and possibly merged with a new version of the file, so the fewer files you edit this way, the less work you have to do.

    Use the Deveopers Toolkit in admin > Tools to search language files for HEADER_SALES_TEXT; that will show you which file to edit and save in your template folder.
    The banner groups are in (I think) Tools > Banner Manager.

 

 

Similar Threads

  1. Commenting Out Php Code to define pages
    By Jay Gee in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Oct 2009, 11:00 PM
  2. Commenting Out "Discount Coupons" text in Information Sidebox
    By bsteinagel in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 4 Mar 2009, 06:01 PM

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