Zen Cart Logo
Forums / Basic Configuration / Blank Sidebox TPL file Apostrophe

Blank Sidebox TPL file Apostrophe

Locked

Views: 1,621

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
19 Aug 2009, 5:16 AM
#1
ryanb4614 avatar

ryanb4614

Totally Zenned

Join Date:
Feb 2008
Posts:
556
Plugin Contributions:
0

Blank Sidebox TPL file Apostrophe

For exmaple:
\includes\templates\template_default\sideboxes\tpl_blank_sidebox.php

This is the file you put in your html, but if I put in text "What's New" the apostrophe throughs the file off and creates an error.

So my question is how do you put in an apostrophe in a file like this?

19 Aug 2009, 7:43 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Blank Sidebox TPL file Apostrophe

That's not a blank sidebox issue, it's a PHP one and will happen wherever you put the apostrophe. This is because the apostrophe is a special character (a string delimiter) in PHP.

To insert a real apostrophe you need to "escape" it, i.e. tell PHP that it should treat it as normal text and not try to use it itself. You do this by preceding it with a backslash.

For example, you could inset an apostrophe as follwoing in a language definition ...

define("TEXT_WHATS_NEW", "What's New");

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

19 Aug 2009, 1:01 PM
#3
ryanb4614 avatar

ryanb4614

Totally Zenned

Join Date:
Feb 2008
Posts:
556
Plugin Contributions:
0

Re: Blank Sidebox TPL file Apostrophe

I know it wasn't a problem with the blank side box I was just giving an example. Works great thank you!