Results 1 to 10 of 29

Hybrid View

  1. #1
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    1,051
    Plugin Contributions
    2

    Have a Drink Re: 1.3.8a - Where do i add custom js for home page only?

    Quote Originally Posted by canopy View Post
    the following file of your Zen Cart installation.

    • docs/read_me_jscript.html
    I didn't see a link from the docs/ index page, so I didn't look any further. I own your book too, and didn't use that either.

    Live and Learn
    JOhn ><>
    Newest Site: ChargerPros - Stuff4Toys

  2. #2
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    1,051
    Plugin Contributions
    2

    Default Re: 1.3.8a - Where do i add custom js for home page only?

    This is messing with my mind. I have exactly the same code from the example page:
    http://www.langeshome.com/KERUSSO/in...show/examples/
    pasted into the define_main_page.php using the text editor instead of FCKeditor. The only difference is the path to the images.
    http://www.langeshome.com/KERUSSO/

    Is the version of mootools conflicting with something Zen-Cart does?

    I created a stylesheet for the slideshow and that loads correctly too!

    Template IC_Academe
    IC's Hooverbox 3
    IH2
    Zen-Cart 1.3.8a (fresh install)
    PHP 5
    MySQL 5

    No other mods or patches installed.

    If someone else wants to play with this slideshow applet, goto http://www.rocketwerx.com/
    I know it was designed for Joomla, but this is also a standalone release too!
    JOhn ><>
    Newest Site: ChargerPros - Stuff4Toys

  3. #3
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: 1.3.8a - Where do i add custom js for home page only?

    Quote Originally Posted by Stuff4Toys View Post
    This is messing with my mind. I have exactly the same code from the example page:
    http://www.langeshome.com/KERUSSO/in...show/examples/
    pasted into the define_main_page.php using the text editor instead of FCKeditor. The only difference is the path to the images.
    http://www.langeshome.com/KERUSSO/

    Is the version of mootools conflicting with something Zen-Cart does?

    I created a stylesheet for the slideshow and that loads correctly too!

    Template IC_Academe
    IC's Hooverbox 3
    IH2
    Zen-Cart 1.3.8a (fresh install)
    PHP 5
    MySQL 5

    No other mods or patches installed.

    If someone else wants to play with this slideshow applet, goto http://www.rocketwerx.com/
    I know it was designed for Joomla, but this is also a standalone release too!
    JOhn ><>
    You can see it working here

  4. #4
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    1,051
    Plugin Contributions
    2

    Have a Drink Re: 1.3.8a - Where do i add custom js for home page only?

    So you have the script loading before your /HEAD

    Ratz, I was hoping I could keep all the code in the define_main_page.php so it could be changed easily.

    What file did you put the script in? can I put it in the same file that loads the .js for the homepage only?

    Like:
    Code:
    <?php
    if ($this_is_home_page) { ?>
    <script type="text/javascript" src="includes/rockslideshow/rokslideshow.js"></script>
    <script type="text/javascript" src="includes/rockslideshow/mootools-release-1.11.js"></script>
    <script type="text/javascript">
        window.RokSlideshowPath = '';
    
        var myshow;
        window.addEvent('load', function(){
            var imgs = [];
    
            imgs.push({
                file: 'shop_new.jpg',
                title: 'New Products',
                desc: 'New Products from Johns Kerusso Store.',
                url: 'http://www.langeshome.com/KERUSSO/index.php?main_page=products_new'
            });
            imgs.push({
                file: 'pray_vote.jpg',
                title: 'Pray Vote Pray',
                desc: 'Think About It',
                url: 'http://www.langeshome.com/KERUSSO/index.php?main_page=index&cPath=6'
            });
            imgs.push({
                file: 'running_empty.jpg',
                title: 'Running on Empty',
                desc: 'There is no bigger topic that the price of gas.',
                url: 'http://www.langeshome.com/KERUSSO/'
            });
            imgs.push({
                file: 'fireproof.jpg',
                title: 'Fireproof - the movie',
                desc: 'Never Leave Your Partner Behind, opens in theaters September 26, 2008.',
                url: 'http://www.fireproofthemovie.com/'
            });
    
            myshow = new Slideshow('slideshow', {
                type: 'combo',
                showTitleCaption: 1,
                captionHeight: 45,
                width: 640,
                height: 375,
                pan: 20,
                zoom: 30,
                loadingDiv: 1,
                resize: true,
                duration: [2000, 9000],
                transition: Fx.Transitions.Expo.easeOut,
                images: imgs,
                path: 'images/homepage/'
            });
    
            myshow.caps.h2.setStyles({
                color: '#fff',
                fontSize: '13px'
            });
            myshow.caps.p.setStyles({
                color: '#ccc',
                fontSize: '11px'
            });
        });
    </script>
    <?php 
    } ?>
    Newest Site: ChargerPros - Stuff4Toys

  5. #5
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: 1.3.8a - Where do i add custom js for home page only?

    Quote Originally Posted by Stuff4Toys View Post
    So you have the script loading before your /HEAD

    Ratz, I was hoping I could keep all the code in the define_main_page.php so it could be changed easily.

    What file did you put the script in? can I put it in the same file that loads the .js for the homepage only?

    Like:
    Code:
    <?php
    if ($this_is_home_page) { ?>
    <script type="text/javascript" src="includes/rockslideshow/rokslideshow.js"></script>
    <script type="text/javascript" src="includes/rockslideshow/mootools-release-1.11.js"></script>
    <script type="text/javascript">
        window.RokSlideshowPath = '';
    
        var myshow;
        window.addEvent('load', function(){
            var imgs = [];
    
            imgs.push({
                file: 'shop_new.jpg',
                title: 'New Products',
                desc: 'New Products from Johns Kerusso Store.',
                url: 'http://www.langeshome.com/KERUSSO/index.php?main_page=products_new'
            });
            imgs.push({
                file: 'pray_vote.jpg',
                title: 'Pray Vote Pray',
                desc: 'Think About It',
                url: 'http://www.langeshome.com/KERUSSO/index.php?main_page=index&cPath=6'
            });
            imgs.push({
                file: 'running_empty.jpg',
                title: 'Running on Empty',
                desc: 'There is no bigger topic that the price of gas.',
                url: 'http://www.langeshome.com/KERUSSO/'
            });
            imgs.push({
                file: 'fireproof.jpg',
                title: 'Fireproof - the movie',
                desc: 'Never Leave Your Partner Behind, opens in theaters September 26, 2008.',
                url: 'http://www.fireproofthemovie.com/'
            });
    
            myshow = new Slideshow('slideshow', {
                type: 'combo',
                showTitleCaption: 1,
                captionHeight: 45,
                width: 640,
                height: 375,
                pan: 20,
                zoom: 30,
                loadingDiv: 1,
                resize: true,
                duration: [2000, 9000],
                transition: Fx.Transitions.Expo.easeOut,
                images: imgs,
                path: 'images/homepage/'
            });
    
            myshow.caps.h2.setStyles({
                color: '#fff',
                fontSize: '13px'
            });
            myshow.caps.p.setStyles({
                color: '#ccc',
                fontSize: '11px'
            });
        });
    </script>
    <?php 
    } ?>
    Yes, that's where it goes.
    The instructions at the demo site for the slideshow are not very clear on this point (at least for the standalone version).

    Also, don't forget the placeholder in define_main_page.php

    <!-- BOF place holder for slide show -->
    <div id="slidewrap">
    <div id="slideshow"></div>
    <div id="loadingDiv"></div>
    </div>
    <!-- EOF place holder for slide show -->

  6. #6
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    1,051
    Plugin Contributions
    2

    Have a Drink Re: 1.3.8a - Where do i add custom js for home page only?

    Quote Originally Posted by clydejones View Post
    Yes, that's where it goes.
    The instructions at the demo site for the slideshow are not very clear on this point (at least for the standalone version).

    Also, don't forget the placeholder in define_main_page.php

    <!-- BOF place holder for slide show -->
    <div id="slidewrap">
    <div id="slideshow"></div>
    <div id="loadingDiv"></div>
    </div>
    <!-- EOF place holder for slide show -->
    Did that, Got that (getting a little frustrated) and it is still not loading. It's got to be something simple, what am I missing?
    JOhn ><>
    Newest Site: ChargerPros - Stuff4Toys

  7. #7
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: 1.3.8a - Where do i add custom js for home page only?

    Quote Originally Posted by Stuff4Toys View Post
    Did that, Got that (getting a little frustrated) and it is still not loading. It's got to be something simple, what am I missing?
    JOhn ><>
    upload these scripts to the root of your site.

    rokslideshow.js
    mootools-release-1.11.js

    then change these in the main script

    <script type="text/javascript" src="includes/rockslideshow/rokslideshow.js"></script>
    <script type="text/javascript" src="includes/rockslideshow/mootools-release-1.11.js"></script>

    TO

    <script type="text/javascript" src="rokslideshow.js"></script>
    <script type="text/javascript" src="mootools-release-1.11.js"></script>

  8. #8
    Join Date
    May 2007
    Location
    SW Florida
    Posts
    1,051
    Plugin Contributions
    2

    Default Re: 1.3.8a - Where do i add custom js for home page only?

    Clyde, I believe that I duplicated what your source code has. One change from the code that I posted was to add the path to rokslideshow.js
    Code:
    window.RokSlideshowPath = 'includes/rokslideshow/rokslideshow.js';
    I am still not having any success.

    I didn't think that this would be rocket science.
    JOhn ><>
    Newest Site: ChargerPros - Stuff4Toys

 

 

Similar Threads

  1. How can i create custom center box, for home page only?!?
    By tcarden in forum Customization from the Admin
    Replies: 2
    Last Post: 7 Dec 2012, 07:05 PM
  2. How to show a custom sidebox only on my home page?
    By SandraSD in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Dec 2009, 08:43 AM
  3. Custom Footer for home page
    By jamesdenny in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 7 Feb 2009, 12:32 PM
  4. How do I add custom content to Home page?
    By emilfalcon in forum Basic Configuration
    Replies: 2
    Last Post: 28 Sep 2007, 09:51 PM
  5. Add new content to home page only?
    By purkat in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Aug 2006, 09:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg