Display related record from another section

2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 27, 2015   (RSS)

By degreesnorth - May 25, 2015

Hi

Two parts to this question, but I think they might have the same solution?

1.  Display fields from another section

I'm not sure how to do this...  I have a brand page, where the detailed page displays details of each of the brands, and then another section where it displays the products, where there is a drop down to select the brand when I enter it on the CMSB.  What I'd like is for the brand page to have some sort of 'where = "brand" - but how do I get the right products of this brand to display ONLY on the relevant brand pages?

2.  Assigning links from a different section as a list

I have a section called product categories, eg. loudspeakers, visual products, etc...and want to list them in my include_header.php file.  I also have a different section for products, which has a pull down list (that is linked to product categories), and displays the info on a page called products_summary.php, which ideally should list only the loudspeakers OR only the visual products.  How do I get the product categories link to go to the correct products_summary.php page?  That is, in the code below, how do I assign <?php echo $record['_link'] ?>


                            <ul>
                            <?php foreach ($product_categoriesRecords as $record): ?>
                            <li><a href="<?php echo $record['_link'] ?>"><div><?php echo htmlencode($record['title']) ?></div></a></li>
                            <?php endforeach ?>
          <?php if (!$product_categoriesRecords): ?>
            No records were found!<br/><br/>
          <?php endif ?>
                            </ul>
                            

Thanks