Category Menu

45 posts by 4 authors in: Forums > CMS Builder
Last Post: August 21, 2009   (RSS)

By design9 - June 23, 2009

Hello,

Forgive me is this question has already been addressed. I looked around on the forums but couldn't find the answer I needed. I have built a category menu section so my users can add new categories whenever they need. My question is there a way to take the categories that are in the category menu section and populate them into a drop down list on my home page that links to a specific page that relates to that menu choice? My goal is once the client has input a new category in the backend, that it will automatically show up in the dropdown on home page without my assistance.

Thank you,

April

Re: [apdance9] Category Menu

By ross - June 23, 2009

Hi April

Thanks for posting!

You can definitely setup a drop down menu that has each of your categories as options. You'll then need a bit of javascript to do the re-direct.

What I suggest doing is taking a look through this post:

http://www.interactivetools.com/forum/gforum.cgi?post=64259#64259

That has all the basic code for setting up a category menu. For the time being, why don't you setup a menuTest.php so you can focus specifically on the menus.

Set that up with the default menu code and then post me a copy of that page (attach it, don't just put the code in a post). We'll turn it into a drop down menu from there.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Category Menu

By design9 - June 23, 2009 - edited: June 23, 2009

Thanks Ross!
I have done the test page called menutest.php and put the coding from the post you gave me. Here is the URL: http://www.carolinaparent.com/marketplace/menutest.php

The attachment is also included of the file. Let me know if you need anything else. If you could show me how to put the menu in a drop down list, that would be great!

Thanks!
April
Attachments:

menutest.php 3K

Re: [apdance9] Category Menu

By ross - June 24, 2009

Hi April

Thanks for posting that code. I had a look and think you can try something like this:

<!-- drop down menu for categories starts here -->
<select>
<?php foreach ($categoryRecords as $record): ?>
<option value="<?php echo $selectedCategory['name'] ?>"><?php echo $selectedCategory['name'] ?></option>
<?php endforeach; ?>
</select>
<!-- drop down menu for categories starts here -->


That will create a <select> menu and make each category an option.

Stick that at the bottom of your test page and let me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Category Menu

By design9 - June 24, 2009

Thank so much Ross!

When I placed the code that had
$selectedCategory['name'] I got an undefined error message (see url page example) and when I switched it to $record['name'] it worked great.

http://www.carolinaparent.com/marketplace/menutest.php

Now, I was wondering what would be the best way to make the categories in the drop down hyperlink to a page? Would it be best to set up an URL field and set it up similar to the external link example?

This is what I will be trying to do:
I create the menu section where the user will input the categories. This will be the drop down on the home page. Then I will create a multi-record section that will have advertisers information and their web ad. The ads will fall into one of the categories in the drop down menu. I want the category menu to link to a page that will display all the advertisers/ads that bought an ad for that category. Example: Adoption category in drop-down list will link to page that shows all the advertisers and their ads that relate to Adoption.

Not sure the best way to make this happen and how to create the links.

Thanks so much for your help!
April
Attachments:

menutest_001.php 4K

Re: [apdance9] Category Menu

By ross - June 25, 2009

Hi April

That looks great! Glad you got it going :).

Where do you want these pages to link to? Does each category have a specific URL that you want to use?

There are definitely a variety of options so I want to see what you are aiming for first :).

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [apdance9] Category Menu

By ross - June 26, 2009

Hi April

I think I get it :).

If you select any of those options in the drop down, you'll go to a page that lists items from only that category.

If you select the "all" option, you'll get a list of all the items.

Does that sound about right? Do you have a template for that? Or is that what you linked me to in your last post?

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Category Menu

By design9 - June 29, 2009

Hi Ross,

Yes, that is right. The page I linked you will be the table structure that will contain all the information that will go on the final design page.

Thanks!

April

Re: [apdance9] Category Menu

By ross - June 30, 2009

Hi April

That's perfect. You have the drop down now. All you need is some javascript to do the page changing based on the value.

Give it a shot and let me know where you get to :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/