| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Open a Shadowbox upon entering a page - with a smarty IF | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Open a Shadowbox upon entering a page - with a smarty IF
I've blown more than an hour on this... anyone know the trick?
My goal: upon loading a page, use a smarty if to determine if an element should be displayed, then show it, inside a Shadowbox (div/html, iFrame, whatever). For example, in home.tpl, in the <head>: Code:
Then the include would contain the javascript, as detailed from the shadowbox docs. I know the smarty is good, since it I am using the same if to display text on the page. I'd also like to have it load a shadowbox. I can get everything done except the autoload of the shadowbox. I found this post... but I can't make it work. What's the secret word, or magic handshake? Thanks, Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Open a Shadowbox upon entering a page - with a smarty IF
Did you put the javascript between literal tags?
__________________
_____________________________________________ www.webcreatives.nl | X-Cart Shops X-Cart Versions 4.1.x | 4.2.x | 4.3.x | 4.4.x Parallelweg 124-14, 1948 NN BEVERWIJK The Netherlands |
|||||||||
#3
|
|||||||
|
|||||||
Re: Open a Shadowbox upon entering a page - with a smarty IF
Yes. Of course. I have it working on a regular html page. Just starting to try to port it over to xcart.
This is a basic example of how it can work... Code:
So, for xcart, I took the script and made it an include, and wrapped it in a {literal}. But no joy yet. I think I'm close to figuring it out though, and I will report back.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#4
|
|||||||
|
|||||||
Re: Open a Shadowbox upon entering a page - with a smarty IF
I had shadowbox working fine, with the following:
1. in skin1/customer/home.tpl - immediately after <head> {* SHADOWBOX INCLUDE *} {include file="shadowbox_include.tpl" } {* END-SHADOWBOX INCLUDE *} 2. Contents of shadowbox_include.tpl: Code:
THIS WORKS FINE. Shadowbox loads as expected, if called from an <a rel=shadwobox> tag. So, I thought, why not make an if and look for a smarty variable? The var works as expected... but shadowbox does not seem to like being called like this... In /customer/home.tpl, immediately after <head> Code:
then shadowbox_include-review-confirm.tpl looks like: Code:
Does not do anything. The code works on its own, but not when called in xcart. What am I missing. Anyone care to try this?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#5
|
|||||||
|
|||||||
Re: Open a Shadowbox upon entering a page - with a smarty IF
Ok... making progress.
Copying code from the internet can put all kinds of invisibles into the code... depending on the browser used... So I have a version working, now that I looked at the code with invisibles showing *(thank you Safari 4 js debug for that)... now I need to integrate it with an IF. I'll be back...
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#6
|
|||||||
|
|||||||
Re: Open a Shadowbox upon entering a page - with a smarty IF
OK, now we're cooking with gas.
This is freaking awesome! However, I can't figure out how to pass a language var to the shadowbox open script, because it loads before the page. Hmm... BRB.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#7
|
|||||||
|
|||||||
Re: Open a Shadowbox upon entering a page - with a smarty IF
Wow this is cool.
Playing with hidden divs, so that the content can live anywhere, but the script is universal. Language vars work. I haven't been this thrilled about code in years. This is one of the biggest user interface improvements I've been able to make for xcart. The customer experience is simply much cleaner now. THIS is also the core of the solution for replacing the hideous, dialog_message.tpl More to come... Anyone want to see the work-in-progress? Just PM me.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|