Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default change text and class of categories header

    Hi I have looked through alot of files and tried using the developers toolkit but have not found it.


    But how do I change the text that says "categories" on the categories sidebox header to something else. Also is it possible to change the class and id of that? I don't mean style the current class and id that;'s there I mean actually change the ones that are outputted to something else. For example it's currently
    Code:
     <h3 class="leftBoxHeading" id="categoriesHeading">Categories</h3>
    Thanks.

  2. #2
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default Re: change text and class of categories header

    Tim
    You might take time and read about the stylesheet.css in the Tutorials/FAQ tab on the top of this page


    1. You will edit the stylesheet.css and look for this declaration
    2. a.category-top
    3. And to control the mouse over hover effect find this
    4. a.category-top:hover
    5. And the visited color effect find this
    6. a.category-top:visited
    Mark
    Hare Do

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

    Default Re: change text and class of categories header

    What purpose would you have to change the class and id of that sidebox? What would it gain you? If we know that, perhaps we can suggest a better route.

    The sidebox title will be defined in a language file, so the Developers Toolkit is the best way to locate it quickly. Try the top left box to narrow the search.

  4. #4
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default Re: change text and class of categories header

    Well I'm changing part of a template, swapping out the catagories sidebox of that template for a different catagories sidebox. But I want to keep the class and id of the original sidebox for that part due to liking the original styling and background images.

    THe original was
    Code:
    <h3 class="leftBoxHeading main-sidebox-header-right" id="categoriesHeading">Categories</h3>

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

    Default Re: change text and class of categories header

    You can apply the properties from .main-sidebox-header-right {} to #categoriesHeading {} without having to touch any PHP code. Just copy the relevant properties - you will have to add the #categoriesHeading {} rule to your stylesheet.

  6. #6
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default Re: change text and class of categories header

    Thanks that seemed to work. One other thing. If I wanted to run a small php script in place of the catagories text from in the english.php file how would I do it?

    THis is the php I want to run

    Code:
    <?php
    if ($this_is_home_page) {
        echo "Catagories";
      } else {
        echo "<a href=index.php>Browse all Categories</a>";
      }
    ?>
    I tried this but it didn't work

    Code:
    define('BOX_HEADING_CATEGORIES', '<?php
    if ($this_is_home_page) {
        echo "Catagories";
      } else {
        echo "<a href=index.php>Browse all Categories</a>";
      }
    ?>');

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

    Default Re: change text and class of categories header

    The define is already PHP, so you don't want new <?php tags in there.Rather than running several lines of code in the define, you can use a ternary operator to make the choice:
    PHP Code:
    define('BOX_HEADING_CATEGORIES', ($this_is_home_page'Categories''<a href="index.php">Browse all Categories</a>')); 
    This processes what is between the ? and the : if the expression before the ? is true, or what follows the : if not.

  8. #8
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default Re: change text and class of categories header

    Thanks again. It's not causing any errors, but for some reason even when on the homepage it's showing "Browse All Categories".

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

    Default Re: change text and class of categories header

    What version of Zen Cart is the site running? (look in Tools > Server/Version Info)

    The $this_is_home_page variable was only introduced in v1.3.7 if I recall corectly, so it wouldn't work in earlier versions.

  10. #10
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default Re: change text and class of categories header

    Zen Cart 1.3.8a
    Database Patch Level: 1.3.8

    the $this_is_home_page does seem to work as when I add

    Code:
    <?php
    if ($this_is_home_page) {
        echo "Catagories";
      } else {
        echo "<a href=index.php>Browse all Categories</a>";
      }
    ?>
    into a reg sidebox it does show as it should.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Changing Categories Sidebox Header Text
    By hrsteel in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 29 May 2010, 11:28 AM
  2. Want to remove text and image from Categories Header
    By Gomlers in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Jan 2010, 04:22 AM
  3. 1st Class and 1st Class recorded for different categories
    By fabsanchez in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 29 Nov 2009, 09:58 PM
  4. How do I change the padding and size of the categories under under my main header ?
    By hoygs740 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Jan 2009, 12:03 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR