Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Stop removing the & nbsp; ?

Quote Reply
Stop removing the & nbsp; ?
In our templates we use "& nbsp;" in various places for design
purposes, we also use "<p>& nbsp;</p>". However when you
build the pages and then look at the source code - LinksSQL
has removed all the "& nbsp;" from the code :-(

Which part of which file do we edit to stop this from occurring?

PS - you have to put a space between & and nbsp; otherwise the forum takes it as a space!

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
There is a modification for Links 2.0 in the Resource Center that you can use to allow special HTML characters. It shouldn't be too difficult to port the codes to LINKS SQL.

Regards,

Eliot

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
Do you by any chance have

$LINKS{compress}=1;

set in your Links.pm file?

If so, change it to a '0'

If not, I haven't had any problem with special characters in the templates, and have done some pretty tight formatting, actually (supporting both MSIE and NN) in some of my templates.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
Yes I and had already tried setting it to 0 (zero) but it still deleted the & nbsp;. Also pugdog what about the other thread of mine about cropping long URLs? Any help?

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
I believe that pugdog already replied to your other Thread.

And again, you could easily port the codes to allow special HTML characters written for Links 2.0 to LINKS SQL. Do you know where the Resource Center is located?? Wink

Regards,

Eliot

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
I checked my templates, and the outputs on the site. "& nbsp;" is not being stripped out.

Check any of my pages on my site (view/source) you'll see all the non-breaking spaces.

When you set the $LINKS{compressed}=0, did you remember to rebuild the whole site, and then refresh the pages in your browser?

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
Welp, I don't know the difference between your copy and mine, but I that setting in my Links.pm file and special HTML characters (like for < and >) do not appear.

What I have done to show these special HTML characters is the following:

1) Add the following variables in the Links.pm file:

Code:

$LINKS{nbsp} = qq|INSERT SPECIAL CHARACTER|;
$LINKS{lthn} = qq|INSERT SPECIAL CHARACTER|;
$LINKS{gthn} = qq|INSERT SPECIAL CHARACTER|;


Then in the HTML_Templates.pm in the %GLOBALS hash section, I added the following codes:

Code:

nbsp => $LINKS{nbsp},
lthn => $LINKS{lthn},
gthn => $LINKS{gthn}


Then in the template files, I've added the following tags:

Code:

<%nbsp%>
<%lthn%>
<%gthn%>



Regards,

Eliot

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
I really do not know what the difference is then. I use special (embedded HTML tags) in virtually _all_ my links.

The users can't enter them, but I can through the Admin, and they get passed through to the template parser and out the end. The template parser only looks for "<%...%>" tags and ignores (or seems to) everything else. I have to work around the direct-input and use a text input field (like in the Admin edit area) or I have to escape the characters manually for direct MySQL input. But that is the only problem I've hit.

The reason I suggested that $LINKS{compressed}=1 might do it, is that it's suppoed to chew up any unnecessary white space to make the HTML harder to read (and supposedly to cut download time) but in practice with a good formatter and a fast line, it's just annoying <G>.

I do wonder what the difference in your version and mine would be, then.

Maybe Alex has the answer?

But, you can scan my site and see all the special characters are in the template [output] files, and many are passed through from the database itself. I don't do anything special to use them.

I wonder if you guys added a mod to your site that caused it, so you are actually undoing something you already undid?

Now you've got me worried, since your copies are most likely newer than my copy, if the next release does that, I'll have about 2,000 templates to change!


http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
I have not added any modifications that would affect this. I have not touched the Template.pm file or the nph-build.cgi files. And the only changes I've made to the core file (DBSQL.pm) is adding some subs for redirecting to category pages, new date/time formats, and link/category count. Other than that...I have not made any radical changes to the files. And the special HTML characters do not stick.

Regards,

Eliot Lee

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
You've really got me worried now.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
Eliot,

That solution of yours works like a dream Smile

Thanks for your help.

JeffB

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
You're welcome, jeff.

Regards,

Eliot Lee

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
I don't think it's a matter of the hard coded space being considered a special character within the templates. It seems that using the "& nbsp;" at the beginning or end of a line in link.html is not recognized, possibly because of the surrounding "if" tags. If you add a regular space (keyboard spacebar, for lack of a better term) before and after the hard coded space, it usually shows up fine.

At least, that's been my experience with Links SQL.

Dan

Quote Reply
Re: Stop removing the & nbsp; ? In reply to
Not for me, Dan...I have tried what you have suggested and the special HTML codes (particularly space codes) disappear and do not show up in template files. Tongue

Regards,

Eliot Lee