Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Posts
    94
    Plugin Contributions
    0

    Default Adding a <div> to a single category page

    Hello -

    So my site has a javascript slideshow that runs on the main page, and I would like to replicate that functionality on a product category page. It looks like if I put the script code into /templates/CUSTOM/jscript with a unique DIV ID then I can call the script in a blank <DIV> --- just not sure how to get the <DIV> into the category page...

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding a <div> to a single category page

    A bit more detail on where you want to have this blank div located will help us advise. If the category description area will work, that is a no-brainer, just add the div to the description. If you want it elsewhere, it will be more complicated.

    You do need a PHP test to make sure the script only tries to run for that particular category. A jscript_whatever.php file can hold that test, and only run the script in the right category.

  3. #3
    Join Date
    Aug 2006
    Posts
    94
    Plugin Contributions
    0

    Default Re: Adding a <div> to a single category page

    Quote Originally Posted by gjh42 View Post
    A bit more detail on where you want to have this blank div located will help us advise. If the category description area will work, that is a no-brainer, just add the div to the description. If you want it elsewhere, it will be more complicated.

    You do need a PHP test to make sure the script only tries to run for that particular category. A jscript_whatever.php file can hold that test, and only run the script in the right category.
    Thanks for the reply. So I do want the slideshow on a category description here. I put in the DIV with the same ID, like this
    HTML Code:
    <div id="fadeshow1"></div>
    using the same ID from my main page, just to see if would load the same slideshow but it did not. I can see the DIV when I look at the page source, so I may be misunderstanding how it should work

  4. #4
    Join Date
    Aug 2006
    Posts
    94
    Plugin Contributions
    0

    Default Re: Adding a <div> to a single category page

    I just looked at the source for my main page, and the whole script is being loaded in the HEAD section. How do I get that to load in the HEAD section for a category? I think it's okay if that script is loaded on every category, so long as I only have a DIV in the description of the page where I want the slideshow...

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding a <div> to a single category page

    Actually, it's the other way around. The empty div will silently sit there on any page without a script to use it, while the script without the div will give a fatal error.

    You need a file like /includes/templates/your_template/jscript/jscript_cat_slideshow.php
    with content like
    PHP Code:
    <?php
    if ($current_page_base == 'index' and $cPath == '23') { ?>
    <your script code>
    <?php ?>

  6. #6
    Join Date
    Aug 2006
    Posts
    94
    Plugin Contributions
    0

    Default Re: Adding a <div> to a single category page

    I had given up on this, but I'm circling back to try again... so the script is loading from /includes/templates/<my temlate>/jscript and I can see it in the <head> section when I view the page source. I can also see the empty <div>, but still no slideshow any thoughts or ideas would be much appreciated.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding a <div> to a single category page

    There's nothing I can say without seeing your site live... aside from the obvious "you have some erroneous code somewhere"...

  8. #8
    Join Date
    Aug 2006
    Posts
    94
    Plugin Contributions
    0

    Default Re: Adding a <div> to a single category page

    Quote Originally Posted by gjh42 View Post
    There's nothing I can say without seeing your site live... aside from the obvious "you have some erroneous code somewhere"...
    This is the category page where I want the slideshow:
    http://www.banberryplace.com/index.p...index&cPath=67

    If you view the source you can see 2 iterations of the Dynamic Drive script is being loaded from /includes/templates/ban/jscript - I have added the one with the wrapperID: fadeshow2 - at this point I'm just trying to replicate the slideshow on the main page, figuring that if I can at least get a slideshow to show up then I can change the images as needed...

  9. #9
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,268
    Plugin Contributions
    3

    Default Re: Adding a <div> to a single category page

    We get this sort of thing to work by applying the jscript embedding principles applicable to zencart.

    In general, a "sitewide" enablement of jscript can be achieved by putting the jscript.js file into modules/pages/index
    20 years a Zencart User

 

 

Similar Threads

  1. v150 need a modification to special page. adding additional div
    By tony_sar in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Feb 2012, 03:01 AM
  2. Customizing a single page or category
    By First Action in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 24 Jan 2011, 02:46 PM
  3. Adding extra Div on Categories page
    By lightup in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 27 Nov 2010, 07:01 PM
  4. adding text to a single product page
    By glennnphp in forum General Questions
    Replies: 3
    Last Post: 14 Apr 2010, 06:47 PM
  5. Adding more products onto a single product page
    By Kinred in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 29 Aug 2007, 07:10 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