Oct 07, 2008, 12:01 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1]   Go Down
  Print  
Author Topic: Sorting in Ditto  (Read 492 times)
0 Members and 1 Guest are viewing this topic.
Jachobsen
Jr. Member
*
Posts: 42


« on: Apr 03, 2008, 01:23 PM »

Hi there,

I'm doing a small catalog where I need to list subcategories when choosing a category in the navigation.

The tree looks like this:
Category
             ->Subcategory
                                   ->Product
                                   ->Product
                                   ->Product
             ->Subcategory
                                   ->Product
                                   ->Product
                                   ->Product

When you click a link in the navigation a page shows where new navigation is found. Here the Subcategory title is a header (thus the content of the subcategory document is blank) and the product titles are links in the new navigation.

I'm using a ditto-call to create these lists:
Code:
[!Ditto? &tpl=`produktliste` &sortDir=`ASC` &display=`all` &tplAlt=`produktliste2`!]

The templates are practically just a div with a wayfinder-call to list the links for the products..

My problem is that the last subcategory i made need to be the first one showed on the page, but I the order of the rest has to be the same so I can't just change the sortDir to descending. Is there a way for me to reorder this? I was thinking that maybe i had to use wayfinder to call the subcategories as well in order to set the order as i wanted it (menu-listing) but i'm thinking there probable is a simple solution to this, still using ditto.
Logged
Alik
Jr. Member
*
Posts: 26


WWW
« Reply #1 on: Apr 03, 2008, 02:05 PM »

Two calls of Ditto. First call lists the last category alone and the second all remaining documents/categories.
Code:
[!Ditto? &documents=`lastcatid` ..............!]
[!Ditto? &documents=`id,id,...` ..............!]
« Last Edit: Apr 03, 2008, 02:08 PM by Alik » Logged
Jachobsen
Jr. Member
*
Posts: 42


« Reply #2 on: Apr 03, 2008, 02:29 PM »

Thank you but I'm showing two subcategories per line. tpl1 is creating a div with the wayfinder call and tpl2 is creating a div with the wayfinder call (and a linebreak)

When i do as you describe the remaining documents are also showing in random order.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!