Creating links that pull from specific categories

5 posts by 2 authors in: Forums > CMS Builder
Last Post: October 9, 2008   (RSS)

Hi, Team:

We finally got the Soul site up at www.SoultheSalon.com. Now, we would like to add a products section to the site with minimal effort. Here's what we're trying to accomplish:

+ We have a number of different product lines
+ Within each product line are a number of different product types

For example, the system has a product line called Davines. Davines makes a number of product types: shampoos, conditioners, style aids, oils, etc.

I have set up the product listing so that each product includes the product_line and product_type associated with the description, title, price, sku, etc.

We have multiple product lines, some that have just one product, and others that have 25 products. These are all of various types.

On the Product Listing page, we would like to show:
1. The different product lines with a description of each
2. A list of the different product types offered by the salon in that line.
3. A link for each product type so that when the user clicks on the product type, the system automatically generates a page that lists just the product types in that product line (i.e. Just "Davines shampoos")

Can CMS Builder handle this without our creating a separate PHP page for each product line? I'm not a coder, but I tried a couple of options, and nothing worked.

As an added note, each product line would also have a link to pull up All the products in that line.

Is it possible? Thanks in advance, T

Re: [sagentic] Creating links that pull from specific categories

Thanks, Kenny! I was halfway there. I already had the two sections: I didn't know how to link them up and create the link. It took five minutes to link them up.

I'm about to test it.

[:)]

Re: [tsuluwerks] Creating links that pull from specific categories

Okay, I got it to work with using hyperlink code as /product-line.php?product_line='Davines'. I have a couple of hangups:

+ I can't get it to work with multiple parameters after the ?. For example, I want to show the products that have both "Davines" as the product_line and "Shampoo" as the product_type.
+ I cannot get these two variable titles to show on the page. For example, at the top of the page, it should read:
"Shampoo Products by Davines" where "Shampoo" and "Davines" would be the two variables.

Is this possible?

Re: [tsuluwerks] Creating links that pull from specific categories

By Kenny - October 9, 2008 - edited: October 9, 2008

You can hard code the link as

/product-line.php?product_line=Davines&product_type=shampoo

but I am not sure how to do it where it would be auto-generated. Maybe Dave can help with that one.


To use fields in the metadata, you would need to use the Detail Page code instead of OR in addition to List Page code.

One of the differences (besides the top of page code) is that the echo statements define exactly what table to pull from like this:

<?php echo $product-lineRecord['product_line'] ?>

You can put these almost anywhere on the page, even in the metadata.


On a List Viewer page, it would look like this:

<?php foreach ($product-lineRecords as $record): ?>
<?php echo $record['product_line'] ?>
<?php endforeach; ?>


These will only show up between the "foreach" and "endforeach" statements.

Let me know if that doesn't work.


Kenny