Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Commenting Out a Line in a Template

Commenting Out a Line in a Template

Locked

Views: 959

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
5 Sep 2010, 4:08 PM
#1
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

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:

<!--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

5 Sep 2010, 4:14 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Commenting Out a Line in a Template

/*<?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

5 Sep 2010, 4:20 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

5 Sep 2010, 4:21 PM
#4
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Commenting Out a Line in a Template

kobra:

/<?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 Sep 2010, 4:24 PM
#5
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Commenting Out a Line in a Template

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

5 Sep 2010, 4:25 PM
#6
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Commenting Out a Line in a Template

gjh42:

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

5 Sep 2010, 11:13 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.