Forums / General Questions / & => &

& => &

Locked

Views: 2,343

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
26 Sep 2006, 3:00 AM
#1
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

& => &

Can anyone please help with ensuring that product content &'s are changed to & ?

This previous thread:
http://www.zen-cart.com/forum/showthread.php?t=19837

worked for earlier versions, but not v1.3.5.

Basically I'm looking at the tpl_products_info_display file:

#83 ish <?php echo stripslashes($products_description); ?>

to add something like:

<?php echo zen_output_string(stripslashes($products_description), array('&' => '&'), false); ?>

Also can this cover document_general files?

Many thanks

26 Sep 2006, 6:16 AM
#2
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

Re: & => &amp;

I should clarify the reason I need to do this is because I have included some links to other pages of the shop in the product description text.

Each time I edit the text through Admin the amp; part of & is lost, and so the page does not validate.

Any help please?

28 Sep 2006, 1:57 AM
#3
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

Re: & => &amp;

can anyone please help with this??? :(

28 Sep 2006, 5:38 AM
#4
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: & => &amp;

May be you can refer to the below, about "cleans" html from the description
Html In Short Description

A New Starter again

28 Sep 2006, 5:54 AM
#5
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

Re: & => &amp;

Seethrou

Thanks for the reply, but this change made no difference.

I need to be able to add "&" but when the file is modified, for the "amp;" part to be retained in the code so that it validates.

At present, when the code is modified in any way, the "amp;" is lost, and it reverts back to "&" only.

The specific case is a url link to another page of the shop:

eg: index.php?main_page=product_info**&**products_id=70

Can anyone else please shed any light on this? :down:

28 Sep 2006, 6:35 AM
#6
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: & => &amp;

speeke:

Can anyone please help with ensuring that product content &'s are changed to & ?

This previous thread:
http://www.zen-cart.com/forum/showthread.php?t=19837

worked for earlier versions, but not v1.3.5.Do you know why it does not work in 1.3.5? Do you get an error message when you try to apply the fix? Or isn't it clear where to apply it?

Sidenote:

May be you can refer to the below, about "cleans" html from the description
Html In Short Description
The suggested fix in this thread will not help to fix the invalid HTML. But what it will do is mess up your HTML severely! Depending on circumstances. (unfortunately I can not reply to that thread, the reply button is missing for me there :wacko: )

28 Sep 2006, 6:41 AM
#7
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: & => &amp;

Oops, it's an archived thread I see now, that is why the reply button is missing :-)

28 Sep 2006, 7:25 AM
#8
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

Re: & => &amp;

Hi paulm

Thanks for your reply.

From memory, I think it outputs & on the web page (rather than simply & naturally!!!)

Have you tried this fix with 1.3.5?

I'd be interested to know if it's been successful.

28 Sep 2006, 7:33 AM
#9
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: & => &amp;

Hi speeke,

nope I did not try it yet. I do know about the problem and would like to fix it myself too (although it's quite low on my todo list). But I wondered for what reason you can not get it to work on 1.3.5? That information could help to solve the problem.

So when you apply it do you get an error message, or does it just keep outputting &'s? (not sure what you meant in your last post)

28 Sep 2006, 8:22 AM
#10
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

Re: & => &amp;

OK...

I've tried replacing

<?php echo stripslashes($products_description); ?>

with

<?php echo zen_output_string(stripslashes($products_description), array('&' => '&'), false); ?>

in tpl_product_info_display.php

and it makes no difference. That is, when I go back to edit the same page, the previous & 's are lost, and therefore won't validate (they have reverted back to "&" instead of "&").

Hope this makes more sense :unsure:

28 Sep 2006, 8:40 AM
#11
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: & => &amp;

Ok now I get it :-)

But that seems logical to me, the proposed change only affects the output. Did you check if the html souce shows &'s in stead of &'s after the fix is applied?

28 Sep 2006, 10:03 AM
#12
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

Re: & => &amp;

After the first edit (to include them) - yes.

But once I go and modify something (eg the title of the product description) the html "&" reverts back to simply "&".

28 Sep 2006, 11:24 AM
#13
speeke avatar

speeke

Zen Follower

Join Date:
Jul 2004
Posts:
65
Plugin Contributions:
0

Re: & => &amp;

paulm

I think all is OK now (I'll check more thoroughly over the next few days).

It appears as though I needed to make more changes to other pages as per the archived post, and the meta tags, titles, image names etc were throwing up errors too.

I didn't notice at first because the main culprit was a random featured product, which came and went (obviously).

Anyway, let me know how you go.