We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22797
    • 134 Posts
    My problem was solved, so I have no complaints. I still think it would be nice to have a syntax available to say &templates=`5,7` or &sometv=`’some value’,’some other value’` and so on. Perhaps this could be written as an abstract class that would accept any field. This could either replace or supplement the tagging extender idea.

    Or, even better, here’s a variation on the idea that takes it further by combining and streamlining the ideas of parents/documents, tagging, and filters (just as food for thought):

    &retrieve=`parent(56,32); template(5,7); sometv(-’some value’,-’some other value’); pagetitle(%2007%); anothertv(>=100); createdon(date(2007/01/01 to 2007/12/11, -2007/07/04))`

    This is admittedly a lot more complex than most of the situations I’m faced with, but here’s what it would do: It would include documents in folders 56 and 32, with a template of 5 or 7, with a ’sometv’ value that does not equal ’some value’ or ’some other value’, a pagetitle that includes 2007 in it, an ’anothertv’ value that is greater than or equal to 100, and a createdon date between Jan 1 2007 and Dec 11, 2007, except for July 4 2007 (the word ’date’ in the parameter would signal that the values in parentheses after it are to be understood as dates, and the word ’to’ defines a range).

    Obviously, the syntax of this idea could be altered if you don’t like the way it looks, but something along these lines would work. It would be very powerful.

    You’d have to come up with some way to specify the delimiter for delimited fields, and a few other things like that, but this could be worked into the basic syntax above. Maybe ’delimiter’ could be a pre-defined keyword:

    sometv(delimiter(’,’) -’some value’,-’some other value’);

    Or maybe there’s a more elegant way.

    In any case, having a unified way of filtering would be a HUGE bonus. Feel free to take any and all of these ideas. I’d certainly benefit if you did.

    And you could still make simpler calls using this syntax, for example:

    &retrieve=`parent(4)`
    &retrieve=`id(453,454)`
    &retrieve=`id(453 to 500)`
    &retrieve=`id(453 to 500,600)`

    and so on.

    EDIT:

    You could also use ’and’ and ’or’ as keywords, as a variation on this idea:
    &retrieve=`sometv(’some value’ and (’some other value’ or ’still another value’))`

    or always interpret the comma as ’and’, so the above could be reduced to:
    &retrieve=`sometv(’some value’,(’some other value’ or ’still another value’))`

    With this in mind, references to templates would have to include an ’or’ operator (as opposed to the comma used in the examples further up in this post), because a document can have only one template:

    &retreive=`template(5 or 7)`
      • 11975
      • 2,542 Posts
      Hi,

      Most of your feature request already exists in Ditto and can be accomplished through &filter param.
      Ditto is certanily one of the most powerful snippet and introduce a lot of flexibity with extenders and placeholders add-on.

      It can be a long way to get all the potential of this tool.

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 22797
        • 134 Posts
        I realize that most of the features do exist, but this would be a way of streamlining them into a single parameter, making it easier to learn and use.
          • 10313
          • 375 Posts
          Quote from: paulb at Nov 16, 2007, 04:50 PM

          ... If I write &where=`template = 7 and template = 5` it doesn’t filter either. I’m sure I’m missing something simple. Any advice?

          I don’t know, if it works at all, but that given condition can never be fulfilled. It should read [tt]&where=`template = 7 or template = 5`[/tt]. But, as I stadted above, I don’t know if it works at all.

          Martin