Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Posts
    16
    Plugin Contributions
    0

    Default Customizing a single page or category

    I have put social networking icons at the top of every page in my zen shop, but I have a 'hidden' category which i dont want users to be able to easily share. Is it possible to remove them just from that category?

    My site is
    http://www.firstactionarticles.com/highly_recommended/

    The hidden category is located at http://firstactionarticles.com/highl...index&cPath=48

    Thanks

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

    Default Re: Customizing a single page or category

    Quote Originally Posted by First Action View Post
    I have put social networking icons at the top of every page in my zen shop, but I have a 'hidden' category which i dont want users to be able to easily share. Is it possible to remove them just from that category?

    My site is
    http://www.firstactionarticles.com/highly_recommended/

    The hidden category is located at http://firstactionarticles.com/highl...index&cPath=48

    Thanks
    You can enclose the code that handles the "social networking" in a conditional statement as shown below:

    <?php if (!$current_page_base == 'index' and $cPath == '48') {

    <div id="bannerThree" class="banners"><center>
    <a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="First_Action">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    <a href="http://www.facebook.com/sharer.php?u=http%3A//www.firstactionarticles.com/highly_recommended&t=First+Action+Articles" target="_blank"><img src="http://www.firstactionarticles.com/images/faceshare.jpg" alt="Share this on Facebook" width="72" height="22" border="0" /></a>
    <script type="text/javascript">
    (function() {
    var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
    s.type = 'text/javascript';
    s.async = true;
    s.src = 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(s, s1);
    })();

    </script>
    <!-- Compact Button -->
    <a class="DiggThisButton DiggCompact"></a></center>
    <br></div>
    }
    ?>


    This will show the social networking on each page except for category 48.

  3. #3
    Join Date
    Jan 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Customizing a single page or category

    Hi Clyde,

    Thanks for your response.

    Do you know which page I change this code on?

    I tried just putting it in the banner box through the zen cart admin but it didnt work

    I also tried copying the code into the tpl_main_page.php but that just made my site turn to white space.

    Sorry for the late reply.

    I dont know if it will help but when I post the code into the banner box via the admin the last bit of the added code shows up on the pages ie "} ?>"

    Thanks
    Last edited by First Action; 22 Jan 2011 at 02:05 PM. Reason: adding more info

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

    Default Re: Customizing a single page or category

    Quote Originally Posted by First Action View Post
    Hi Clyde,

    Thanks for your response.

    Do you know which page I change this code on?

    I tried just putting it in the banner box through the zen cart admin but it didnt work

    I also tried copying the code into the tpl_main_page.php but that just made my site turn to white space.

    Sorry for the late reply.

    I dont know if it will help but when I post the code into the banner box via the admin the last bit of the added code shows up on the pages ie "} ?>"

    Thanks

    Do you know which page I change this code on?


    It would be the page you edited when you inserted the code. I'm guessing it was tpl_main_page.php

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,267
    Plugin Contributions
    3

    Default Re: Customizing a single page or category

    Clyde's method is the tidy option.

    But you could also create a category-specific stylesheet and use a {display: none} declaration on the div that contains the social networking elements.

    The naming convention for these stylesheets is in a README file that accompanies the CSS files (look in the css folder).
    20 years a Zencart User

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,267
    Plugin Contributions
    3

    Default Re: Customizing a single page or category

    I use category-specific stylesheets HERE to give different categories different design characteristics.
    20 years a Zencart User

  7. #7
    Join Date
    Jan 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Customizing a single page or category

    Quote Originally Posted by clydejones View Post

    Do you know which page I change this code on?


    It would be the page you edited when you inserted the code. I'm guessing it was tpl_main_page.php
    The problem is that I didnt actually change any code. I did it through the admin 'edit banner boxes'

    I did try to change the tpl_main_page but all I got was white space.

    Below is what I did

    Original

    <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
    }
    }
    ?>


    New

    <?php if (!$current_page_base == 'index' and $cPath == '48') {

    <div id="bannerThree" class="banners"><center>
    <a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="First_Action">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    <a href="http://www.facebook.com/sharer.php?u=http%3A//www.firstactionarticles.com/highly_recommended&t=First+Action+Articles" target="_blank"><img src="http://www.firstactionarticles.com/images/faceshare.jpg" alt="Share this on Facebook" width="72" height="22" border="0" /></a>
    <script type="text/javascript">
    (function() {
    var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
    s.type = 'text/javascript';
    s.async = true;
    s.src = 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(s, s1);
    })();

    </script>
    <!-- Compact Button -->
    <a class="DiggThisButton DiggCompact"></a></center>
    <br></div>
    }
    ?>


    Result was that my whole site turned to white.

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

    Default Re: Customizing a single page or category

    Quote Originally Posted by First Action View Post
    The problem is that I didnt actually change any code. I did it through the admin 'edit banner boxes'

    I did try to change the tpl_main_page but all I got was white space.

    Below is what I did

    Original

    <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
    }
    }
    ?>


    New

    <?php if (!$current_page_base == 'index' and $cPath == '48') {

    <div id="bannerThree" class="banners"><center>
    <a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="First_Action">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    <a href="http://www.facebook.com/sharer.php?u=http%3A//www.firstactionarticles.com/highly_recommended&t=First+Action+Articles" target="_blank"><img src="http://www.firstactionarticles.com/images/faceshare.jpg" alt="Share this on Facebook" width="72" height="22" border="0" /></a>
    <script type="text/javascript">
    (function() {
    var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
    s.type = 'text/javascript';
    s.async = true;
    s.src = 'http://widgets.digg.com/buttons.js';
    s1.parentNode.insertBefore(s, s1);
    })();

    </script>
    <!-- Compact Button -->
    <a class="DiggThisButton DiggCompact"></a></center>
    <br></div>
    }
    ?>


    Result was that my whole site turned to white.
    look in the cache folder on your server and check the error log files.

    what error is being reported.

 

 

Similar Threads

  1. v150 Adding a <div> to a single category page
    By Terrill_Taylor in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 20 Aug 2013, 09:42 AM
  2. v139h How do I display a single category listing on a defined page?
    By DivaVocals in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 29 May 2012, 04:30 PM
  3. Customizing the Category Page
    By DLLong in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Oct 2009, 04:06 PM
  4. Customizing the Category Page
    By magicpants in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 10 May 2006, 03:34 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