Skip navigation
Paul-Atl
Currently Being Moderated

Image rotation working in template, but nowhere else

Mar 4, 2012 7:05 PM

Hi,

I'm relatively new to Dreamweaver.

I have a page with some rotating images, created following a Communitymx recommendation (http://www.communitymx.com/content/article.cfm?cid=651FF).

 

The website template (http://www.johnaverill.com/templates/main_template.dwt) seems to rotate images perfectly; however, image rotation on index.html and the others will not work.

 

Any help or recommendations would be greatly appreciated.  Thanks, Paul

 
Replies
  • Currently Being Moderated
    Mar 4, 2012 7:35 PM   in reply to Paul-Atl

    May be relevant that you have both Templates and templates on your folder and link paths.

    *nix servers are case sensitive

     

    Should all be capital T

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 5:21 AM   in reply to Paul-Atl

    Your images folder - _images - should NOT be in your 'templates' folder. Move it to where your index.html file is located then the images will most likely rotate.

     

    Also why are you using a 'framset'???? to display the page.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 5:48 AM   in reply to osgood_

    Hi Osgood -

     

    Not sure I see the -images folder in the Templates folder

    http://averill.cybersynergics.com/_images/2.jpg

     

    I too wonder why Paul is using a 'frameset to display the page.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 5:47 AM   in reply to Paul-Atl

    On a Windows server, case would not matter

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 5:56 AM   in reply to osgood_

    Actually its more complex than above.

     

    The rotation script on your index.html page is NOT the same as that on your main_template.dwt file. How did you create the index.html because it certainly was not from the template file?????

     

    Do this, open the main_template.dwt file. Go into code view and scroll down until you find the code below:

     

     

    <div class="container">

      <div class="header">

        <div align="center"><!-- TemplateBeginEditable name="header_image" -->

    <body onload="preloadImgs();randomImages();">

    <img src="../_images/1.jpg" name="rotator" width="960" height="300" id="rotator" /><!-- TemplateEndEditable -->

     

     

     

    Your opening <body> tag is NOT in the correct place in the code.

    Cut this line: <body onload="preloadImgs();randomImages();"> and paste it back in above the 'container' opening <div> (as shown below):

     

     

    body onload="preloadImgs();randomImages();">

    <div class="container">

      <div class="header">

        <div align="center"><!-- TemplateBeginEditable name="header_image" -->

    <img src="../_images/1.jpg" name="rotator" width="960" height="300" id="rotator" /><!-- TemplateEndEditable -->


     

    Close the main_template.dwt file.

     

    Now youre going to make your index.html from the main_template.dwt file.

     

    In Dreamweaver Design view go to >New> and select 'page from Template' from the left side column. Select your site  which will be listed and select the main_template.dwt file and press create. Save it as index_2.html into your site root folder.

     

    Now if you open up index_2.html and run it through a browser you should see the revolving images appear.

     

    Get the 'editable region' copy you need from the index.html page and paste it into index_2.html. When you've copied it over get rid of index.html and rename index_2.html to index.html.

     

    Get rid of the Frameset as well, it will cause you nightmares.


     

     


     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2012 5:53 AM   in reply to Ken Binney

    Ken Binney wrote:

     

    Hi Osgood -

     

    Not sure I see the -images folder in the Templates folder

    http://averill.cybersynergics.com/_images/2.jpg

     

    I too wonder why Paul is using a 'frameset to display the page.

    Hi Ken,

     

    Both the below urls work BUT it could be something to do with those pesky Frameset thingys which confuse everything.

     

     

    http://www.johnaverill.com/templates/_images/1.jpg

     

    http://www.johnaverill.com/_images/1.jpg

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 6, 2012 11:51 PM   in reply to Paul-Atl

    Paul-Atl wrote:

     

    Thank you Osgood_

    I followed your guide here.  Unfortunately it did not make the difference.   pretty sure I followed it to the T -  to the point of creating index_2.html.

    Thank you also for the tip on removing framesets.  I will look into this.

     

    Don't give up, sure it will work. If your template works then ANY page made from it WILL work. Post a link to the index.html page again please.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 8, 2012 5:58 AM   in reply to Paul-Atl

    Your index.html HAS NOT  been made from the template file!!!!!!!!

     

    This is the link to your template file (which is working, right) http://www.johnaverill.com/templates/main_template.dwt

     

     

    For instance in the template file the <body> tag appears in the wrong place (which I informed you in the earlier post)

     

    <div class="container">

      <div class="header">

        <div align="center"><!-- TemplateBeginEditable name="header_image" -->

    <body onload="preloadImgs();randomImages();">

     

     

    When in the index.html page the <body> tag appears in the correct place:

     

    <body onload="preloadImgs();randomImages();">

    <div class="container">

      <div class="header">

     

    The rotating script is also different in the template file to that of the index file (which I alslo informed you about in the earlier post)

     

    In your index page you have acquired an extra:

     

     

    function randomImages(){

       if(counter == (imgs.length)){

         counter = 0;

       }

     

    The index page cannot have been made from the template.dwt file otherwise the code would be the SAME as the template file, so the question is how are you making the index.html file?????

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points