Add .js (Page Peel Off Script) to album
fabiansfx
Joined: 2009-12-11
Posts: 6 |
Posted: Fri, 2009-12-11 20:33 |
For a special website feature I need a page peel off effect which I found on this site: http://www.marcofolio.net/webdesign/create_a_peeling_corner_on_your_website.html I cannot find out on which page to embed the code so the peel off effect shows on all pages. Can someone please help me? Thanks! Fabian |
|
Posts: 16504
Don't know which theme you're using. But if using Matrix or most standard themes, you'd probably need to add the code to /themes/YourTheme/templates/local/theme.tpl
Be sure to wrap the javascript in {literal} tags:
{literal}
JAVASCRIPT HERE
{/literal}
I bolded the local directory above for you to take note that you should create that directory and copy the theme.tpl file into that directory and make your changes there. See this for more info:
http://codex.gallery2.org/Gallery2:Editing_Templates
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 6
ok!!
Great!
I understand the Local part, but the placing of the script is not important within the theme.tpl?
Posts: 16504
Think of theme.tpl as your "normal" .html page. That's where the head and body of the html page is defined. So, I'd probably just follow the instructions on that other page. Honestly, I'd probably see if I could put the JS into a separate .js file and load that so you're not re-downloading all of that JS with every single page load.
But if you do put the JS in the smarty based .tpl page you'll need to be sure to wrap it with {literal} tags.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 6
Thanks .
I thought it was just simple copy paste, but those {literal} tags must be more like:
{if $theme.pageType == 'album' || $theme.pageType == 'photo'}
<script src="peel/peel.js" type="text/javascript"></script>
But I have to spend more time on this.. tis is completely new to me .
Posts: 16504
See this for more info on the literal tag:
http://www.smarty.net/manual/en/language.function.literal.php
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 27300
You don't need literal tags if youy are just adding:
<script src="peel/peel.js" type="text/javascript"></script>
But in your above example for only adding the code the albums and photo pages then you need to close the if:
{/if}
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 6
hmmm.. I must be missing something.
I cannot get this simple thing to work...
Is there anybody who uses a similar script?
Posts: 16504
A link to your site where you're trying to get this working would be helpful if you need help with this.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 6
I'm working on this page:
http://impact-sfx.com/media/main.php
Long from perfect, but it's a start
Posts: 27300
Edit the js file
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 6
Thank you all!!
It finally worked!
The main problem in the end was: cache... not only the templatecache settings in Gallery2, but also the cache in my local browser did some strange things...
Just to see what happenes, I tried the same thing on Safari in 'private mode / no cache' and it worked like a charm!
Thank you all for helping me out!