Page 1 of 1

Using Extra Attributes to sort content

Posted: Fri Aug 07, 2009 11:03 pm
by Golf Gti
I am a rookie when it comes to cmsms and mysql.

I was wondering if there is a way to sort content pages by the extra page attribute?
What I mean is there a way pull the extra page attribute 1 to create a listing of all pages with the data.

so

if extra attribute 1 is equal to 249.99 and other extra attibute are 249.99 display title and link to all pages equal to 249.99

Thanks for any help.

Re: Using Extra Attributes to sort content

Posted: Sat Aug 08, 2009 12:10 pm
by NaN
Sounds like you're looking for some kind of categorizing pages.
No bad idea but if pages belongs to the same "category" why not group them as submenu under a sectionheader?
So you have the relations of all pages in the hierarchy.
Or did i get the wrong end of stick?
(I'm afraid your'e looking for something more complex.)

Do you wat to show the pages in Menu or in Content?

Re: Using Extra Attributes to sort content

Posted: Sun Aug 09, 2009 12:23 am
by Golf Gti
No bad idea but if pages belongs to the same "category" why not group them as submenu under a sectionheader?
I have my pages layed out like this.

Basically I have products in different catagories/headings that I need to sort by this attribute, no matter where the page is.

So if i Selected 249.99 from a link or drop down, all content pages, no matter what location is displayed.
Kinda like how you sort by price and brand on futureshop and bestbuy and other ecommerce sites (this is not for ecommerce, just finding similar products/pages).

Is it possible to sort all content, or just the content under a certain sub heading.

Sorry in advance if this is hard to decipher.

Re: Using Extra Attributes to sort content

Posted: Sun Aug 09, 2009 12:58 am
by Dr.CSS
If you wanted to show a page with just pages with a certain attribute and it is one of the ones menu manager recognizes you may be able to make a menu, template, list out of them and display this in the page somewhere...

But you want a drop down of this criteria so now you have to give the page it shows on another attribute to make a select menu for it...

Re: Using Extra Attributes to sort content

Posted: Mon Aug 10, 2009 5:54 am
by Golf Gti
If you wanted to show a page with just pages with a certain attribute and it is one of the ones menu manager recognizes you may be able to make a menu, template, list out of them and display this in the page somewhere...

But you want a drop down of this criteria so now you have to give the page it shows on another attribute to make a select menu for it...
Nice this seems to work like I want, now I just need to play around with it.

I tried:
{menu loadprops="1" template="test"}
and a {if $node->extra1 ==search term inside extra1}

Thanks for the great suggestion. Great to see its basically built in, CMSMS astonishes me everyday.

I'll post a more detail once I finish it to my likeing.

Re: Using Extra Attributes to sort content

Posted: Tue Aug 25, 2009 7:39 pm
by Golf Gti
Here is my code I used for bringing up pages when extra content= a value
I have played around with the code soo many times, I cant figure out how to have the page headings (the category/heading the content is listed under) I have multiple categories and the list is spaced out where the heading should be.


                - space where category/heading should be
Item 1
                - space where category/heading should be
Item 2
Item 3
                - space where category/heading should be
Item 4
Item 5

Code: Select all

{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *} 
{if $count > 0}
<ul class="clearfix">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}

{if $node->current == true}

{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}

{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}

{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="separator" />

{else}
{if $node->extra1 ==499}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}</a>
{/if}
{/if}

{/foreach}

{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Any help would be greatly appreciated.

Re: Using Extra Attributes to sort content

Posted: Sun Aug 30, 2009 7:35 pm
by Dr.CSS
This would require seeing the page, as in a link...