DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

Reply
 
Thread Tools Display Modes
Old 02-13-2012, 06:30 AM   #1
john_b
Member
 
Join Date: May 2006
Location: Scottish Borders, UK
Posts: 208
Default hold the Javascript!

I'm trying to construct a (web) page to explain how users might make use of a 'lightbox' feature on a Joomla-based website that I'm admin for. Part of the explanation that I'm trying to show requires that the user copies/pastes a piece of text at the top of their own page. The text is

{artprettyphoto /}

Unfortunately, when I include this in my article, Javascript (or JQuery???) thinks the text is there simply for its benefit and swipes it off the page. Result being that I can't show the line of text that I need to...

...I've tried using ascii codes to replace the curly brackets but no joy. So I suppose my question is whether there's a way to create a small Javascript-free zone on the page so that it will leave it where I put it?

Alternatively, am I missing the blindingly obvious??

I hope the above makes some kind of sense - I know what I mean...;-)

John
john_b is offline   Reply With Quote
Old 02-14-2012, 03:24 AM   #2
Kelvyn
Staff
 
Kelvyn's Avatar
 
Join Date: Feb 2005
Location: In the Heart of the English Lake District
Posts: 1,381
Default

Using the TinyMCE editor in Joomla 2.5.1 that line is not stripped out, looks just fine.

A dodge with older versions of Joomla was to switch to code edit and use form tags:

<form>
{artprettyphoto /}
</form>

Not valid, of course, but used to work OK.


   
__________________
Kelvyn

Web site design, hosting and marketing, Keswick in the UK Lake District

If you are planning a visit to Keswick then try Keswick Tourist Information website

Kelvyn is offline   Reply With Quote
Old 02-14-2012, 06:26 AM   #3
john_b
Member
 
Join Date: May 2006
Location: Scottish Borders, UK
Posts: 208
Default

I think the trouble is that installation of the lightbox plugin means that that particular string is interpreted by Javascript (or JQuery) as soon as it sees it. (I'm sure there are technical terms and phrases that I ought to be using, but I don't know what they are.)

Yes, it's an old version of Joomla and I tried the <form> tags trick. No luck, though, so I think we'll just have to admit defeat...

...if I put the curly brackets round the other way

}artprettyphoto /{

..and explain why, then that's the best I can manage...;-)

Thanks for your help, though!

John
john_b is offline   Reply With Quote
Old 02-14-2012, 09:51 AM   #4
LoisWakeman
Staff
 
LoisWakeman's Avatar
 
Join Date: Jan 2005
Location: Uplyme, Devon, England
Posts: 1,402
Default

I think you may be looking for "escape" - as in, "how do I escape special characters?"

In JS, it's the backslash, and from what I have Googled, for Jquery you need double backslashes - but that was in the script itself, so no idea if it works in HTML. Try it and see, I guess!
LoisWakeman is offline   Reply With Quote
Old 02-14-2012, 11:11 AM   #5
john_b
Member
 
Join Date: May 2006
Location: Scottish Borders, UK
Posts: 208
Default

Yes, you're right that escaping characters is a possible approach...

...but this is a stubborn critter and just won't respond to treatment!!

Tried double, single, forward and backslashes but as soon as Javascript gets a mere whiff of it, then it's swiped off the page and sent away for processing to... well who knows where...???

Thanks for the suggestion!

John
john_b is offline   Reply With Quote
Old 02-15-2012, 02:02 AM   #6
Kelvyn
Staff
 
Kelvyn's Avatar
 
Join Date: Feb 2005
Location: In the Heart of the English Lake District
Posts: 1,381
Default

On the site I tested it with I have JQuery but with modal for the lightbox effect. Nothing should alter code within <form> tags.

Another way is to put the text in a module and place it in the article using {loadposition xx} - it should not strip that as it is part of system coding used in Joomla.

   
__________________
Kelvyn

Web site design, hosting and marketing, Keswick in the UK Lake District

If you are planning a visit to Keswick then try Keswick Tourist Information website

Kelvyn is offline   Reply With Quote
Old 02-15-2012, 09:17 AM   #7
john_b
Member
 
Join Date: May 2006
Location: Scottish Borders, UK
Posts: 208
Default

Thanks for that, Kelvyn. I tried the <form> tags ruse again but still nothing.

Your suggestion re creating module may be promising but I suspect it may be a tad outside my skills zone. I'll investigate...

For the number of users I'm aiming at (which is small) I think I may just call it a day and put the curly brackets round the wrong way with an explanatory note.

Thanks for your help!
John
john_b is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eudora 7.1 with Java, JavaScript dthomsen8 Software 14 05-17-2007 02:43 PM
Firefox 1.5 JavaScript Console Kelvyn Web Site Building & Maintenance 0 12-13-2005 12:01 PM
Help with JavaScript coding ilox Web Site Building & Maintenance 15 09-07-2005 01:50 AM


All times are GMT -8. The time now is 06:11 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Contents copyright 2004–2014 Desktop Publishing Forum and its members.