Category Menu
45 posts by 4 authors in: Forums > CMS Builder
Last Post: August 21, 2009 (RSS)
By design9 - June 30, 2009
Thanks!
April
Re: [apdance9] Category Menu
By ross - July 3, 2009
We'll definitely want to stay focused on one thing at a time here as it looks like you are trying to do a few different things right now.
Where would you like to start? The javascript stuff might end up taking some extra work as that isn't exactly something we support :).
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/
By design9 - July 6, 2009 - edited: July 6, 2009
[font "Verdana"]This is what I have so far:
http://www.carolinaparent.com/marketplace/marketplace.php
[font "Verdana"]Thanks!
[font "Verdana"]April
Re: [apdance9] Category Menu
By ross - July 7, 2009
I think I understand what you mean with the page that displays a category and then all the items for that category under it, but that's a completely different thing than the drop down menu so I think we should try focusing on one at a time :).
I just want to make sure though that we are talking about the same things.
It sounds to me like you want each item in that drop down to link to a page like this one:
http://www.carolinaparent.com/marketplace/marketplace.php
But when you link to there from the drop down, only the category you picked will show up.
The link by itself will just show all categories.
Does that sound about right? Let me know :).
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/
By design9 - July 8, 2009
Also, I figured out the javascript for the dropdown menu and it works great! I can post it if it may be helpful for others to see it.
Thanks!
April
Re: [apdance9] Category Menu
By ross - July 8, 2009
Great :).
What you'll definitely want to do is make sure this:
http://www.carolinaparent.com/marketplace/marketplace.php
is a list page so when you go to just the URL, it brings up all your records. If you were to go to this URL instead:
http://www.carolinaparent.com/marketplace/marketplace.php?category=Ross
That will automatically run a search and only show you records whose category is Ross. Does that make sense?
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/
By design9 - July 9, 2009
Thanks so much for all your help! That works perfectly for seperating the categories. My only last issue is on the ALL page that shows all categories and all listings...how do I get the specific listing to fall under the category title and get the category title to pull in? I want to put them into a table format. See example: http://www.carolinaparent.com/marketplace/marketplacefinal.php
EX: So, for the Camps block...only the camp invention would show up there and under the health block...only the 123 smile Dental and Lee Family Medicine would show there instead of all listings.
Would I need to use an if statement????
Thanks!
April
Re: [apdance9] Category Menu
By ross - July 9, 2009
Great!
I actually thought that marketplacefinal.php was your final page but if it isn't, there is a way to make the categories appear one time each and then list all the items for them underneath.
The first thing you'll need to do is have that page sorted on the category field. You can do that in the section editor or right on the page.
After that, you'll have to create a variable just outside of your foreach loop called $lastCategory
Get that part all setup for now and then attach a copy of your page for me.
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/
By design9 - July 13, 2009
I figured it out and it works great! This is the code I am using:
<?php $lastCategory = ""; ?>
<?php foreach ($marketplaceRecords as $record): ?>
<?php if ($record['cats'] != $lastCategory): ?>
<?php $lastCategory = $record['cats']; ?>
<b><?php echo $record['cats'] ?></b>
<?php endif ?><br /><br />
<a href="<?php echo $record['_link'] ?>"><b><?php echo $record['title'] ?></b>
<?php endforeach; ?>
This is my question now:
I plan to have 3 multi record sections.
<?php foreach ($marketplaceRecords as $record): ?>
<?php foreach ($marketplace_classifiedsRecords as $record): ?>
<?php foreach ($marketplace_couponsRecords as $record): ?>
Each of sections use ['title'] for the field name to list the business name.
One for ads, one for coupons, and one for classifieds. I understand how to put multi records on a single page, but I am wondering if it is possible to combine those into the catgory code (above) so they will all pull into the same table instead of me having 3 seperate sections/tables on the page.
Thanks!
April
Re: [apdance9] Category Menu
By ross - July 14, 2009
Glad you got that working :).
Getting your three sections all listing in that same table can be done I believe but it will be a little tricky.
What you would need to do is use some PHP to combine all three of your arrays ($marketplaceRecords, $marketplace_classifiedsRecords, $marketplace_couponsRecords) and then do the foreach loop with that new array. One really important thing is that all three sections would likely need to have the same fields. I know you mentioned they all have the 'title' field but do they all have the same other fields?
Does that make sense?
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/