Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hi,

I need to put couchcart products into 2 columns on a page

The left column would show Blue Widgets, and the right column Red widgets.

I have no idea how to even start this, and when I have tried so far have totally failed :(

Please could someone offer some detailed advice as to how this might be acheivable.

Thanks
You need some way to internally distinguish between red and blue widgets. Have you enabled folders for the template or alternatively defined an editable region to hold this value?
cheesypoof wrote: You need some way to internally distinguish between red and blue widgets. Have you enabled folders for the template or alternatively defined an editable region to hold this value?


I was thinking of having a dropdown in Admin for blue/red widgets but have no idea how to proceed from there.
Folders are not enabled, I have read the folder info in docs and am not sure how that would help......
Alright, so lets say you defined a dropdown region like so:
Code: Select all
<cms:editable
    label = 'Widget Color'
    name = 'widget_color'
    opt_values = '-- Select a Color --=- | Blue=blue | Red=red'
    required = '1'
    type = 'dropdown'
/>

When outputting the widgets, the pages tag allows you to specify a custom field filter:
Code: Select all
<h2>Blue Widgets</h2>
<cms:pages custom_field='widget_color==blue'>
    <a href="<cms:show k_page_link/>"><cms:show k_page_title/></a>
</cms:pages>

<h2>Red Widgets</h2>
<cms:pages custom_field='widget_color==red'>
    <a href="<cms:show k_page_link/>"><cms:show k_page_title/></a>
</cms:pages>


Folders would perhaps be even simpler:
Code: Select all
<cms:folder label='Blue' name='blue'/>
<cms:folder label='Red' name='red'/>

<h2>Blue Widgets</h2>
<cms:pages folder='blue'>
    <a href="<cms:show k_page_link/>"><cms:show k_page_title/></a>
</cms:pages>

<h2>Red Widgets</h2>
<cms:pages folder='red'>
    <a href="<cms:show k_page_link/>"><cms:show k_page_title/></a>
</cms:pages>
Thanks for that, I will have a go this evening and let you know how I get on
Worked well, thanks for your help :)
6 posts Page 1 of 1
cron