Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / User greeting references duplicated

User greeting references duplicated

Views: 592

Results 1 to 8 of 8
9 Nov 2011, 2:44 AM
#1
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

User greeting references duplicated

Hi.

I create a header.php in ../includes/languages/english/extra_definitions/MY_THEME/
with:

<?php
define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="https://familynow.ca/index.php?main_page=login">log yourself in</a>?');
define('TEXT_GREETING_PERSONAL', 'Welcome back <span class="greetUser">%s</span>! Would you like to see our <a href="%s">newest additions</a>?');
?>

Now when I enable Customer Greeting in the admin I get the greeting twice on the main page. I can figure out where the could is pulling that in the middle one. I see it in the html but where is it grabbing it from?

see here

13 Nov 2011, 1:08 AM
#2
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: User greeting references duplicated

Anyone?

13 Nov 2011, 3:21 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: User greeting references duplicated

familynow:

I create a header.php in ../includes/languages/english/extra_definitions/MY_THEME/
That's the wrong folder for the customized file.

If you're customizing a file found in /includes/languages/english/ then the correct place to put the CUSTOMIZED version of that file is in /includes/languages/english/YOUR_THEME/

Anything you put in the extra_definitions folder will be loaded on ALL pages, which is probably why you're running into duplicates.

13 Nov 2011, 6:09 AM
#4
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: User greeting references duplicated

Thank you for correcting that. I was following this[1] in post #4.

Unfortunately, it's still duplicating in the middle as before.

ref.
[1]
ZC forum post

13 Nov 2011, 6:12 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: User greeting references duplicated

Your custom template has added the code to insert that greeting on the top:```

<!-- B0F GREETING-->
	<div class="greeting">		Welcome <span class="greetUser">Guest!</span> Would you like to <a href="https://familynow.ca/index.php?main_page=login">log yourself in</a>?				</div>
<!-- EoF GREETING-->

And then the normal template is also displaying it where it normally does:
<div class="centerColumn" id="indexDefault">

<h2 class="greeting">Welcome <span class="greetUser">Guest!</span> Would you like to <a href="https://familynow.ca/index.php?main_page=login">log yourself in</a>?</h2> ``` You can find these things yourself by right-clicking the page in your browser and choosing View Source. And then use the search to find the text you're looking for. In this case, searching for "welcome" shows both instances.
13 Nov 2011, 6:31 AM
#6
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: User greeting references duplicated

I had already found that too. How do I remove it though? I can't find which file it's in.

13 Nov 2011, 1:52 PM
#8
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: User greeting references duplicated

Brilliant! Not certain why I can't remember to use the tool kit first...Anyway. Thank you!

The greeting was referenced here

includes/templates/THEME/templates in tpl_index_default and tpl_index_categories in case anyone encounters this.