Category Menu

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

By design9 - August 6, 2009 - edited: August 6, 2009

Dave,

Thanks for all your help! This is exactly what I wanted in your example http://www.carolinaparent.com/marketplace/testmarket3.php for everything to feed into one table. Now I just have 2 questions:

1. What would be the best way to get my check marks to show up when it is a fetured ad, etc. I have a checkbox in my backend that when slected it will show the check. this was the code I was using before to make it work:

<?php if ($record['featured_ad']): ?><img src="check.gif" width="34" height="23" /><?php endif ?>

this worked great but now that the coding is a little different, I changed the $record to $item to match your coding but it works except for items that are not featured, give me an undefined index error. Not sure how to fix that. You can see my example here: http://www.carolinaparent.com/marketplace/marketplacefinal.php

2. Is there any way to make it where it doesn't show the category name if there are no listings under them (like Adoption for example doesn't have any listings)?

Thanks for your help!

April

Re: [chris] Category Menu

By design9 - August 10, 2009

Sure, I have attached the file with the source code that Dave set up for me (testmarket3.php).

Thanks for your help!

April
Attachments:

testmarket3.php 3K

Re: [apdance9] Category Menu

By Chris - August 11, 2009

Hi apdance9,

You mentioned above that you wanted to combine your three multi-record sections into one (HTML) table, but the columns for your table are named after your sections, leading me to believe you want to do something like a "join" instead of an array_merge.

Do you want checkmark images for marketplace_classifieds and marketplace_coupons records to show up on the same row as your marketplace records and their "featured ads" checkmark images? When will those other checkmark images appear? What fields in what records in what sections will determine if they appear?
All the best,
Chris

Re: [chris] Category Menu

By design9 - August 17, 2009

[font "Verdana"]I am not really sure if I need to do a join or a merge. The way Dave had it set-up in the above example (http://www.carolinaparent.com/marketplace/marketplace.php) works great; I just don't want the category to show if there is no listing under it. Not sure how to make that work.

As far as the check marks, I want them to display under the appropriate table...if it is a feat ad the check mark will show there, if it is coupon it will show there (across from advertiser name). The way I am making that work is I have set-up a checkbox in the backend that is called "featured_ad" ( I would do the same for the other records (coupon, classifieds). This was the code I was using before to make it work:

<?php if ($record['featured_ad']): ?><img src="check.gif" width="34" height="23" /><?php endif ?>

this worked great but now that the coding is a little different, I changed the $record to $item to match Dave's coding but it works except for items that are not featured, give me an undefined index error. Not sure how to fix that. You can see my example here: [url "http://www.interactivetools.com/forum/forum.cgi?url=http%3A%2F%2Fwww.interactivetools.com%2Fforum%2Fforum.cgi%3Furl%3Dhttp%253A%252F%252Fwww.carolinaparent.com%252Fmarketplace%252Fmarketplacefinal.php"][font "Verdana"]http://www.carolinaparent.com/marketplace/marketplacefinal.php[/#003366][/url][font "Verdana"]


Thanks for your help!

April



[font "Verdana"]

Re: [apdance9] Category Menu

By Chris - August 17, 2009

Hi April,

Let me see if I understand this correctly...

Say you have three records:

(record in the marketplace section:)
cats: Health
title: Doggy Day Spa
featured_ad: no

(record in the marketplace_classifieds section:)
cats: Health
title: Doggy Day Spa
featured_classified: no

(record in the marketplace_coupons section:)
cats: Health
title: Doggy Day Spa
featured_coupon: no


You would want this to appear as a single line item (under the Health category) with no check marks?
All the best,
Chris

Re: [chris] Category Menu

By design9 - August 17, 2009

In my html table I have 3 sections on the right that says: featuredads, classifieds, coupons. Let's says the advertiser has a featured ad and a coupon and the featured_ad and the featured_coupon has been checked (yes) in the backend then the checkmark will appear under that title within the table. See this example: http://www.carolinaparent.com/marketplace/marketplace.php

This lets the user know at a glance what that advertiser is offering. Hope this helps!

Thanks!

April

Re: [apdance9] Category Menu

By Chris - August 17, 2009 - edited: August 17, 2009

Hi April,

I think I have figured out what it is you're trying to accomplish and have attached an example of how to do it.

I set up my own category, marketplace, marketplace_coupons, and marketplace_classifieds sections and tried to mimic what I think you're doing. The example code I've written will not display empty categories, will associate marketplaces with marketplace_coupons and marketplace_classifieds (based on them having the exact same title), and will populate the checkbox images based on three fields: marketplace.featured_ad, marketplace_classifieds.featured_classified, and marketplace_coupons.featured_coupon.

Since I don't know what else you're doing with your CMSb install, I can't suggest that you reorganize your sections; however, if this was the only Viewer needed, I would have used only two sections (category and marketplace) making things much, much, much simpler.

I hope this helps and best of luck!
All the best,
Chris

Re: [chris] Category Menu

By design9 - August 17, 2009

Hi Chris,

I am sorry that I am not getting this but I set up your example http://www.carolinaparent.com/marketplace/apdance.php and all the categories that do have listings are not pulling in and the listings are not displaying as needed like in my http://www.carolinaparent.com/marketplace/testmarket3.php example. My category field is called name so I changed that but I must be missing something else. Can you point me in the right direction of what I need to update to make it work like the above example with the listings/categories displaying correctly?

Thanks!

April

Re: [apdance9] Category Menu

By Chris - August 17, 2009

Ahem, I had a small bug in there, try this one instead. Sorry!
All the best,
Chris
Attachments:

apdance.php 4K