close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

galleries with sub cats

Thread began 7/25/2016 5:14 am by Jamie | Last modified 8/05/2016 10:13 am by Ray Borduin | 2158 views | 25 replies |

Jamie

galleries with sub cats

Hey Ray

That site we discussed briefly the other day with the main gallery and images that would be selected to go into sub categories - have redone the db and now have the main category table (gallery_category_contents) and the image table (gallery_category) as discussed (see attached)

Initial query at this stage is that this structure (as it stands at the moment) doesnt allow for creating the sub category (eg parent category is 'weddings' and then sub categories within that parent category) creation - was wondering what your thoughts would be to best accommodate that?

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

Just add a CategoryParentID column to the table and use 0 for parent categories.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

Yeah, but what about the naming of the sub cat ?

At the moment, each parent category has 1 galery which is identified as gallery_1, gallery_2 etc. Within each of those I need to further subdivide and the client needs to be able to name the subdivisions.....

Sign in to reply to this post

Ray BorduinWebAssist

You can use the same table structure for sub categories, so they would have a name just like the main categories. Just use the name field.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

hey Ray

as per caht the other evening, have basically got the main structure sorted.

couple of thing at this point:

1) on the update page (attached) amd struggling to get the dropdown at line 215 to show the selection associated with what is in the db
2) on the results page (attached) am struggling to get the sub cat to at line 335 to show and display under the appropriate parent category

have also attached a a screenshot of the db structure

next step is to get the image management pages to associate with the sub categories...

cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

On the update page select list you have:

<option value="<?php echo($Category->getColumnVal("ProductContentsID")); ?>" <?php if (!(strcmp($row_WADAgallery_contents['ProductContentsID'],$Category->getColumnVal("CategoryID")))) {echo "selected=\"selected\"";} ?> style="padding: 5px 10px 5px 10px;"><?php echo($Category->getColumnVal("ProductName")); ?></option>



the value should match the comparison, so I think it should probably be:

<option value="<?php echo($Category->getColumnVal("CategoryID")); ?>" <?php if (!(strcmp($row_WADAgallery_contents['ProductContentsID'],$Category->getColumnVal("CategoryID")))) {echo "selected=\"selected\"";} ?> style="padding: 5px 10px 5px 10px;"><?php echo($Category->getColumnVal("ProductName")); ?></option>



On the results page you should be moving your subcategory recordset into your category repeated region and filtering it based on the row in the category.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

thanks

on the results page am not sure how to structure the filter and have tried a variety with no luck:

$SubCategory->setQuery("SELECT * FROM gallery_category_contents WHERE ProductContentsID = ? AND CategoryID <> 0");
$SubCategory->bindParam("i", "".(isset($_GET['CategoryID'])?$_GET['CategoryID']:"") ."", "-1"); //colname



and

$SubCategory->setQuery("SELECT * FROM gallery_category_contents WHERE CategoryID = ? AND CategoryID <> 0");
$SubCategory->bindParam("i", "".(isset($_GET['ProductContentsID'])?$_GET['ProductContentsID']:"") ."", "-1"); //colname



and also

$SubCategory->setQuery("SELECT * FROM gallery_category_contents WHERE CategoryID = ProductContentsID");
Sign in to reply to this post

Ray BorduinWebAssist

$SubCategory->setQuery("SELECT * FROM gallery_category_contents WHERE CategoryID = ?");
$SubCategory->bindParam("i", "".($row_WADAgallery_contents['ProductContentsID ']) ."", "-1"); //colname
Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

thanks Ray but that just returns all the parent categories rather than just the sub cats ......http://prntscr.com/byy8u6

Sign in to reply to this post

Ray BorduinWebAssist

What is the name of parent category id column? I'm just trying to guess based on your example.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...