We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I'm am building an event list pulled from multiple resources. I'm using MultiTV for the event times, venues, etc. However, I'm unable to sort the output.

    Here's my ditto call.
    [!Ditto? &startID=`880`
     	&tpl=`thursday-tpl`
    	&includeTVs=`1` 
    	&processTVs=`1` 
    	&includeContent=`1` 
    	&display=`99`
    	&depth=`0`
    	&showInMenuOnly=`0`
    	&debug=`0`
    !]

    Here's the MultiTV call in the ditto tpl
    [[multiTV? 
    	&tvName=`show-times` 
    	&docid=`[+id+]`
        &outerTpl=multi-tv-wrapper-tpl
    	&rowTpl=multi-tv-tpl
    	&display=`99`
    	&where=`{"day":"Thursday"}`
    	&debug=`0`
    	&orderBy=`display-order`
    	&reverse=`0`
    	&published=`1` 
    	]]

    &orderBy in the tpl has no effect, nor does &reverse. If I put &orderBy in the ditto call I get a white page with that says "error".

    The display-order field is a simple text field that contains a number for the display order. I tried making it a number field. No change. It's also not sorting items from the same resources. Setting &reverse=`1` does not sort the two Event1 items (below). This is the ouput.
     Display Order: 14 - Event 3 - Thursday - 2:00 PM - 3:00 PM - Venue 3
    Display Order: 12 - Event1 - Thursday - 12:45 PM - 12:58 PM - The name of the Venue
    Display Order: 13 - Event1 - Thursday - 1:00 - 3:00 PM - Venue 3 


    Any suggestions?
    • You could only sort all ditto results (but not by the content of a multiTV) or each multiTV content of a resource by a column. Sorting both together is not possible with horizontal, vertical, datatable multiTV display mode.

      This could only be done by dbtable display mode. In that mode the multiTV content is saved into a custom database table. But you have to write an own snippet to display the custom table content and you have to write some processors, that save/filter the custom table content with the current resource id.
        • 36551
        • 416 Posts
        Jako

        Thanks for the fast response. I wouldn't be able to do all that so I managed a work around. I found a small script that will sort the specified html elements as the page is rendered. It may not be the most elegant solution but it seems to be working.