Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Is this possible? replacing text with image?

Is this possible? replacing text with image?

Locked

Views: 2,658

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
15 Dec 2009, 3:37 PM
#1
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Is this possible? replacing text with image?

Hi,

I am wanting to change 'Create account' and 'Forgotten Password' with two different images. Is this possible?

If so what would I need to add and where?

Many thanks

15 Dec 2009, 3:58 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Find the phrases you want to replace in your language files. Replace the text with :
<img src="/relative/path/IMAGE.gif" alt="My alt text" />

15 Dec 2009, 5:01 PM
#3
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Thanks for your reply...tried that but nothing happened :dontgetit

15 Dec 2009, 5:13 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Is this possible? replacing text with image?

Then you may have edited the wrong copy of the file. By "nothing happened" do you mean the original text stayed as is?
Double-check which file you edited.

16 Dec 2009, 5:19 PM
#5
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

:frusty:

Done it three times now. Just tried to change the text on these four files for Forgotten Password

/home/sites/ampmgraphics.com/public_html/demo/includes/languages/english/extra_definitions/login_header_defines.php

Line #27 : define('ACCOUNT_BOX_PASSWORD_FORGOTTEN','Forgotten Password');
 
/home/sites/ampmgraphics.com/public_html/demo/includes/languages/english/extra_definitions/red_passion/login_box_defines.php

Line #33 : define('LOGIN_BOX_PASSWORD_FORGOTTEN','Forgotten Password');
 
/home/sites/ampmgraphics.com/public_html/demo/includes/languages/english/extra_definitions/red_passion/login_header_defines.php

Line #27 : define('ACCOUNT_BOX_PASSWORD_FORGOTTEN','Forgotten Password');
 
/home/sites/ampmgraphics.com/public_html/demo/includes/languages/english/red_passion/password_forgotten.php

Line #12 : define('HEADING_TITLE', 'Forgotten Password');

Just replaced the words forgotten password between ' ' with Test and nothing changed?!? :dontgetit

so the first file code looked like this

Line #27 : define('ACCOUNT_BOX_PASSWORD_FORGOTTEN','Test');

Very odd..wondered if it needed a little longer to register the change so waited.. but no difference.

Wierd...am I missing something?? If not I will re-try them all again...can't see it could be anything else??

16 Dec 2009, 5:27 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Glen's point applies...

If you are editing a DEFINE statement, and no difference appears, then you are editing the incorrect file (or alternatively, you are FTP-ing it to the incorrect location after making the edits.)

16 Dec 2009, 5:54 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Is this possible? replacing text with image?

Do a Developers Toolkit search on
define('ACCOUNT_BOX_PASSWORD_FORGOTTEN'
and see what the line looks like. If it still says 'Forgotten Password' then your edit didn't get back to your server.

16 Dec 2009, 6:16 PM
#8
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

First, you don't need the path to your image to start from the root of your webspace ...

A simple -

includes/templates/YOUR_TEMPLATE/images/YOUR_IMAGE.gif

should do it. Make sure the image is in the correct directory and that your modified language files are in the correct override directory.

17 Dec 2009, 4:18 PM
#9
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

I have done the same thing. Changed all the 'Forgotten Password' bits in each file, ftp'd the files and then as before checked if there were any left or I had missed anything by doing another search.

No change to the text on the site and no files containing 'Forgotten password' :dontgetit

Searching 289 files ... for: forgotten password
 
Match Lines found: 0
Warning Error: No matching Configuration Keys were found ... forgotten password

I am ftp'ing the correct site and viewing the right site. Never had this issue before...

Really don't understand this..

Any ideas?

Thanks

17 Dec 2009, 4:28 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Are you searching in the CATALOG or ADMIN ?

17 Dec 2009, 4:39 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Is this possible? replacing text with image?

If you have changed 'Forgotten Password' to something else, you shouldn't be able to find that in your files. That may be a positive sign. Now search for the text you changed it to. And be sure to try both searches on "all files", not "admin".

17 Dec 2009, 4:52 PM
#12
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Thanks..yeah I did that. I changed it to 'Test5' and did a search and the four same files showed up...but still the text on the site hasn't changed?? :dontgetit

17 Dec 2009, 5:15 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Is this possible? replacing text with image?

The "forgotten password" you are talking about appears to be generated by some custom code inserted in tpl_header.php.```html

<div id="headerLogin"><!--eof-branding display--> <!--eof-header logo and navigation display--> <form name="account_box" action="http://www.ampmgraphics.com/demo/index.php?main_page=login&action=process&zenid=85aft1mkq9mbhb9il5kp6el8h1" method="post"><div align="right"> <table border="0" cellpadding="0" cellspacing="0"> <tbody><tr> <td class="boxText" align="right" valign="middle">Email:</td> <td class="boxText" align="right" valign="middle"><input name="email_address" size="10" type="text"></td> <td class="boxText" align="right" valign="middle">Password:</td> <td class="boxText" align="right" valign="middle"><input name="password" size="10" type="password"></td> <td class="boxText" align="right" valign="center"> <input value="Log In" style="width: 40px;" type="submit"></td> <td> <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=password_forgotten&zenid=85aft1mkq9mbhb9il5kp6el8h1">Forgotten Password</a>   <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=login&zenid=85aft1mkq9mbhb9il5kp6el8h1">Create Account</a><input name="securityToken" value="aa0836be6c498b25313075b1db8b35d4" type="hidden"></td></tr> </tbody></table></div> </div> </form> ```Exactly what does the <td> <a class="menu" line look like in /includes/templates/red_passion/common/tpl_header.php?

And by the way, your code in this snippet looks incorrect. It starts with

<div> <form> <table> and ends with </table> </div> </div> </form> when it should end with </table> </form> </div> </div>
17 Dec 2009, 5:22 PM
#14
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Hm ok, thanks for that...I will have a look

The line reads

<td> <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=password_forgotten&zenid=85aft1mkq9mbhb9il5kp6el8h1">Forgotten Password</a>   <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=login&zenid=85aft1mkq9mbhb9il5kp6el8h1">Create Account</a><input name="securityToken" value="aa0836be6c498b25313075b1db8b35d4" type="hidden"></td>

I will see if I can now sort this (will have to be tomorrow now)

In the meantime I have changed all the files back to contain forgotten password.

Thanks for taking the time to look and help.

Will let you know how I go..

17 Dec 2009, 5:27 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Is this possible? replacing text with image?

That is what the line looks like in tpl_header.php?
If so, you have hard-coded the text Forgotten Password into the file, and no defined constant is going to affect it.
You have also included a zenid in the link, which would cause problems in use, essentially logging anyone who clicks the button into the session that was running when you copy/pasted the code.

18 Dec 2009, 11:54 AM
#16
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Thanks again for the reply...

Sorry you have lost me a little! :blush:

So what exactly do I need to do to solve the issue?
Thanks

18 Dec 2009, 1:37 PM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: Is this possible? replacing text with image?

On reflection, I'm not sure what you have done, as if you had hard-coded Forgotten Password into that file, it would have shown up in the Developers Toolkit search. Does the PHP file /includes/templates/red_passion/common/tpl_header.php contain the exact line you posted above?

If it does, the quick fix would be to edit it to say whatever text you wanted to replace Forgotten Password. (And remove the zenid=...)

18 Dec 2009, 3:13 PM
#18
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Glenn's right... it has been hardcoded somewhere, but the template's been heavily customised, so extablishing just how this has been done is not easy when looking at the page's html source.

That Login header under the logo graphic is definitely a custom coded element, and as Glenn points out, is likely to be in your tpl_header.php file

Open the following file:

includes/templates/red_passion/common/tpl_header.php

... "copy" the contents of the file, and post them her on the forum (embrace this text using the CODE icon above - the one that looks like a speech bubble).

If you do not have tpl_header.php in:
includes/templates/red_passion/common/

... then look at the CORE file:
includes/templates/template_default/common/tpl_header.php

18 Dec 2009, 3:46 PM
#19
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Is this possible? replacing text with image?

Thanks for the replies

Strange...that has solved it. (changed text within the tpl file) :dontgetit

<td> <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=password_forgotten&zenid=85aft1mkq9mbhb9il5kp6el8h1">Test6</a>   <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=login&zenid=85aft1mkq9mbhb9il5kp6el8h1">Create Account</a><input name="securityToken" value="aa0836be6c498b25313075b1db8b35d4" type="hidden"></td>

So guess I will be able to pop the image in this place?

What bit of this code do I need to delete? Once I have deleted this bit will it work ok?

Thanks

18 Dec 2009, 6:56 PM
#20
gjh42 avatar

gjh42

Black Belt

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

Re: Is this possible? replacing text with image?

<td> <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=password_forgotten&zenid=85aft1mkq9mbhb9il5kp6el8h1">Test6</a>   <a class="menu" href="http://www.ampmgraphics.com/demo/index.php?main_page=login&zenid=85aft1mkq9mbhb9il5kp6el8h1">Create Account</a><input name="securityToken" value="aa0836be6c498b25313075b1db8b35d4" type="hidden"></td>

Delete the parts in red - they are bad to have hard-coded. The part in green needs to be dynamically generated, and may need to match an existing dynamic number or it will fail - I don't know how the token works.

What you really need is to locate the PHP code that generates this output; copy/pasting it as you appear to have done destroys its ability to act dynamically. You could just paste the image tag in place of the "Test6" text, but I am not sure it would operate correctly even after that.