Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Lightbox2 and SlideViewer and it's looking in the wrong folder

Status
Not open for further replies.

damienflanders

Technical User
Jun 27, 2010
24
US
hello,

I'm using lightbox2 and slideviewer and if you look at my website:

and go to the gallery button (for the lightbox)
and go to the graphic services (for the slideviewer)
and do a page source you will see the following:

<!--lightbox2 script-->

<script type="text/javascript" src="Templates/js/prototype.js"></script>
<script type="text/javascript" src="Templates/js/scriptaculous.js?load=effects,builder"></script>

<script type="text/javascript" src="Templates/js/lightbox.js"></script>
<link rel="stylesheet" href="Templates/css/lightbox.css" type="text/css" media="screen" />

<!--lightbox2 ends-->



<!--slideviewer script-->
<script src="Templates/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="Templates/js/jquery.easing.1.2.js" type="text/javascript"></script>
<script src="Templates/js/jquery.slideviewer.1.2.js" type="text/javascript"></script>

<script type="text/javascript">
$(window).bind("load", function() {
$("div#photoretouch").slideView()
});
</script>


<!--end of slideviewer script-->


Why is it looking in the Templates folder? and how do i change that??

I put the code in the template so that it I can use the code on any page if I happen to want to put slideviewer or lightbox on any other page. but I don't understand how to NOT make it look in the Templates folder which is a subfolder and acutally shouldn't be uploaded at all anyway.

thanks
 
if the script is in the Templates folder then that is where the page will look. what is the path to the file from your root folder (the folder where the pages are kept).

Darryn Cooke
| Marketing and Creative Services
 
there's nothing in the Templates folder but Templates. (2 of them, one i no longer use.)

i have my main folder, Racing Mind press, that holds all my .html files and then beneath that I have:

images folder
css folder
.js folder
etc.
 
so just change the path - is that not working?

what is your code in the template folder that points to these files?

also can you spell out your file structure? i.e.

[ROOT]
/images
/.js
/templates
index.html
about.html
etc...

Darryn Cooke
| Marketing and Creative Services
 
I just noticed that if i don't put a "\" in front of the location,
it automatically puts "Templates" in front of the location.


if i do this

<script type="text/javascript" src="/js/prototype.js"></script>\

when i go to preview, i don't get this:

<script type="text/javascript" src="Templates/js/prototype.js"></script>

by the way, where should your templates folder, with your templates be stored?
 
you can store it where ever you want - i dont work with templates - instead I use included if i have information i need on every page.

i just did a test and the path worked fine - how is your site folder defined? this could be the issue - make sure your site default folder points to the root of the site.

you need it to appear as "js/prototype.js"

check your site settings.

Darryn Cooke
| Marketing and Creative Services
 
okay, so the [ROOT] would be the website
so,

[ROOT]
/images
/p7spepper
/scripts
/Templates
/viewers
art_for_sale.html
dayofall+.html
fervor.html
gallery.html
graphic_services.html
index.html
info.html
publications.html
tshirts.html

i had a folder called "css" and i changed it to "viewers" and a folder called "js" and changed it to "scripts"

there is a css file called "p7spepper05.css" and if i move it from the Templates folder and put it somewhere else it won't be found. It has to be in the template folder, then in a subfolder called "p7spepper".

so the script will look like this:
<link href="p7spepper/p7spepper05.css" rel="stylesheet" type="text/css" />

and then when i preview the page and go to page source i find it saying:

<link href="Templates/p7spepper/p7spepper05.css" rel="stylesheet" type="text/css" />

and if i move the "p7spepper05.css" and try and redirect it to the new location it WON'T FIND IT AND WON'T WORK.

i'm beginning to think that i should put all my css and .js files in the TEMPLATES folder so that they will all work.

i can't figure this out...
 
under local info:

Site name: Racing Mind Press

Local root Folder:
C:\Racing Mind Press\

Default Images Folder (left blank)

Links relative to
Document or Site Root

i unchecked Document and checked Site Root

HTTP address:

cache
enable cache checked
 
ok.

so i put the 2 folders containing the .js and .css files in the

Templates folder

[ROOT]
/Templates/viewers (.css files in here)
/Templates/scripts (.js files in here)

the slide viewer is working !! on my GRAPHIC SERVICES PAGE
but...
the LIGHTBOX is not working the GALLERY PAGE

can't figure out why not at the moment.

for some reason, it puts the TEMPLATES in front of everything
so i figured if you can't beat the problem, join the problem...

i don't know why it's doing it...
 
ok i've gone over this thing with a fine tooth comb. the only thing that won't work is the lightbox on my gallery page.
 
can i recommend you look into includes instead of template files. Includes are much easier and really will help you.

using HTML you call an include using

<!--#include virtual="path to file/include-file.html" -->

so you can have a page like this

Code:
<!--#include virtual="head.htm" -->
<body>
<!--#include virtual="menu.htm" -->
<div>your individual page content here</div>
<!--#include virtual="sidebar.htm" -->
<!--#include virtual="footer.htm" -->

That way you just edit one file (the include file) when you want to make global changes.

So "head.htm" would be everything in the HEAD section including doctype etc.

"menu.htm" would be your header portion of your webpage.

"sidebar.htm" is simply a sidebar if you want a 2 column page.

"fotter.htm" is the footer.

so your directory could look like this.

[ROOT]
head.htm
menu.htm
sidebar.htm
footer.htm
index.htm
style.css
javascript.js

-----

you can even put your CSS and JS into folders and just change the path in "head.htm".

I have never liked templates.

Using either methods however have SEO implications that are negative.

Darryn Cooke
| Marketing and Creative Services
 
no -

for starters each page should have its own unique <TITLE> tag - basic example "Your company name - Page title" - and the META description tag that provides a description for each page.

you could append your "head.htm" file to NON include a </head> tag and instead include that in your page

Code:
<!--#include virtual="head.htm" -->
<title></title>
<meta name="description"...
</head>
<!--#include virtual="menu.htm" -->
<div>your individual page content here</div>
<!--#include virtual="sidebar.htm" -->
<!--#include virtual="footer.htm" -->

the title tells search engines what to name your page and the description is just what it is.

Darryn Cooke
| Marketing and Creative Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top