Results 1 to 16 of 16
  1. #1
    ABW Ambassador boningroup's Avatar
    Join Date
    January 18th, 2005
    Location
    Slidell, LA
    Posts
    667
    Question Templete or something like it
    I recently had someone redesign one of my sites. I have switched over to the new design for all of the sections of my site except for categories. The designer set up a list of 31 main categories to the left of the pages on the site. Each category has sub-categories.

    I don't want to have to change each page on my site when I add a new category or sub-category. Today the designer tells me "i dont know how to do that dynamically".

    So let me see if I can explain what I am looking for and hopefully someone can steer me in the right direction. All that I know is simple html.

    I am looking for a designer, design or a program where I can set up a separate template for each category and as I add a new subcategory, all the pages within the original category will automatically update. In other words there are 31 categories on my home page. When someone clicks on the "shoes" category they will go to the main shoe page and the list on the left side of the page will have all 31 categories but all the shoe subcategories will show on the list on the left side of the page. As I add more categories to the shoes list it automatically updates all the pages in that category. I know I will have to set up something seperate for each category but if I can do one category, I can set up the rest.

    I don't know if I can list my site that I need to do this to but it is located at:
    http://www.bgshoppingmall.com
    Danny W Bonin Jr
    Bonin Group, Inc.

  2. #2
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    You need your categories and sub-categories in database tables.

  3. #3
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    If I am not understanding you at all, please just ignore this post, but.....

    I have include statements for the different parts of my site -- header, footer, navigation listing, etc. This way it only has to be updated in one file and your good to go.

    I personally use php like so....

    <?php
    include 'category_listing_file.php';
    ?>

    To do this with php, however, you would have to have that ability on your server.


    Hope this helps!

  4. #4
    ABW Ambassador boningroup's Avatar
    Join Date
    January 18th, 2005
    Location
    Slidell, LA
    Posts
    667
    Quote Originally Posted by SeymourButts
    You need your categories and sub-categories in database tables.
    And how would I do that. Is there someplace I can go to and read up on this?
    Danny W Bonin Jr
    Bonin Group, Inc.

  5. #5
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    England
    Posts
    4,327
    If you are using dreamweaver, you can use templates. Create new pages based around the template.

    You can probably do something silimar with the other programs

  6. #6
    ABW Ambassador boningroup's Avatar
    Join Date
    January 18th, 2005
    Location
    Slidell, LA
    Posts
    667
    Quote Originally Posted by bettylou
    To do this with php, however, you would have to have that ability on your server.


    Hope this helps!
    I do have php on my server.
    Danny W Bonin Jr
    Bonin Group, Inc.

  7. #7
    ABW Ambassador boningroup's Avatar
    Join Date
    January 18th, 2005
    Location
    Slidell, LA
    Posts
    667
    Quote Originally Posted by Julian
    If you are using dreamweaver, you can use templates. Create new pages based around the template.

    You can probably do something silimar with the other programs
    No I am using what looks like basic html language.
    Danny W Bonin Jr
    Bonin Group, Inc.

  8. #8
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    After re-reading your post, I realize you are also wanting some type of dropdown under your active category.

    You could definitely do this with a database like SeymourButts said. That would be the way that I would do it, but if you aren't into databases, you could do an if statement.

    For example, if the category = shoes, then show the subcats under the main cat.

  9. #9
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    England
    Posts
    4,327
    Quote Originally Posted by boningroup
    No I am using what looks like basic html language.
    Yes, but your pages can be built using a template. The template dynamically updates the menu on each page as you add (or delete) categories

  10. #10
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    May I ask how you are creating your category list currently?

  11. #11
    ABW Ambassador boningroup's Avatar
    Join Date
    January 18th, 2005
    Location
    Slidell, LA
    Posts
    667
    Quote Originally Posted by bettylou
    May I ask how you are creating your category list currently?
    A simple html code inserted into the page. What I am trying to avoid is having to add a line of code to every page of my site when I add a new subcategory or category.

    I hope that some of you that have responded realize that a lot of this is "greek" to me.
    Danny W Bonin Jr
    Bonin Group, Inc.

  12. #12
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    And do you have template files for the header/footer or do you actually have the header and footer section coded out on every page of your site?

  13. #13
    ABW Ambassador boningroup's Avatar
    Join Date
    January 18th, 2005
    Location
    Slidell, LA
    Posts
    667
    Quote Originally Posted by bettylou
    And do you have template files for the header/footer or do you actually have the header and footer section coded out on every page of your site?
    Coded out on every page. I'd rather have it set up on a template file. This is I guess what I am trying to do!!
    Danny W Bonin Jr
    Bonin Group, Inc.

  14. #14
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Eeek! We definitely want to switch you over to templates. It's not really all that tough.

    Let's say this is the code to create a web page, over simplified and laid out with tables versus CSS, :

    <table><tr><td>LOGO IMAGE HERE</td></tr>
    <tr><td>SEARCHBOX HERE</td><tr></table>

    <table><tr><td>
    <table><tr><td>CATEGORY LISTING HERE</td></tr></table>
    </td><td>MAIN CONTENT HERE</td><tr></table>

    <table><tr><td>FOOTER CONTENT HERE</td><tr></table>


    1. Create a header file. This is just the code that you have for your current header. So take the first part of the code that you have for pages currently and put this in its very own file. I noticed that you have different headers on your homepage and product category pages. Assuming that you want to have the one shown on your homepage throughout your site, simply take the code for for just that part of the page and put it in this file.
    In the example above the header would be:
    <table><tr><td>LOGO IMAGE HERE</td></tr>
    <tr><td>SEARCHBOX HERE</td><tr></table>

    or, if you want, you could include the category listing section as well.

    Save this file as header.php (or whatever you want to call it).

    2. Now create your category listing table. In the above example, it would be this section:
    <table><tr><td>CATEGORY LISTING HERE</td></tr></table>

    save this as cat_listing.php

    3. Create a footer file. From the example above:
    <table><tr><td>FOOTER CONTENT HERE</td><tr></table>

    save this as footer.php


    I am not all that familiar with PopShops but I think that appears to be what you are using. I don't know if you have the ability with popshops to dynamically create a product page from a variable or not (maybe someone else will know and can answer that).

    Anyway, the finished page would look like this if each category page is static:

    PHP Code:
    <?php
    //INCLUDE STATEMENT TO CALL HEADER FILE
    include 'header.php';
    ?>

    <!--MAIN CONTENT TABLE INCLUDING CATEGORY LISTING-->
    <table><tr><td>

    <?php
    include 'cat_listing.php';
    ?>

    </td><td>PUT YOUR POPSHOPS CODE HERE</td><tr></table>

    <?php
    //CALL TO INCLUDE FOOTER
    include 'footer.php';
    ?>
    Now save this file as shoes.php or beauty.php, whatever the product page happens to be.

    Keep in mind that my example code above is strictly for illustration purposes. Nesting tables isn't really supposed to be done.

    Now, if you need to add to the category listing, you can simply add it to one file (cat_listing.php) and it will appear on all you pages. Same thing goes for the header and footer.

    I hope this makes a little sense. I am not the greatest at explaining things. If you have any questions, please ask.
    Last edited by bettylou; October 7th, 2008 at 06:33 PM. Reason: Error in final code layout

  15. #15
    ABW Ambassador boningroup's Avatar
    Join Date
    January 18th, 2005
    Location
    Slidell, LA
    Posts
    667
    I CAN'T BELIEVE HOW EASY THAT WAS!!!!!!!!!!!!

    Thanks! I also can't believe that the guy who designed my site didn't know how to do this.

    BettyLou if we ever meet I owe you a big hug!!
    Danny W Bonin Jr
    Bonin Group, Inc.

  16. #16
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Yaaay! I am so glad that it worked. And you're right, it is easy once you can get your mind wrapped around the concept. It took me a while but I'm rather simple .

  17. Newsletter Signup

+ Reply to Thread

Posting Permissions

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