Constraints
  • Vote Up0Vote Down AndelAndel
    Posts: 95Member
    Hi,

    constraints="type is news"


    This lists only something with an article type of news, right?

    How would I write it if I wanted the list to show items from TWO different article types?

    Cheers

    Andel
  • 5 Comments sorted by
  • Vote Up0Vote Down AndelAndel
    Posts: 95Member
    Hi again,

    I *did* read the manual and template guide and can't find an answer for this question. If I simply add a "type is xyz" (e.g. constraints="type is news type is xyz") nothing at all gets shown. So obviously the most logical way doesn't work. So please, what will work?

    Cheers,

    Andel
  • Vote Up0Vote Down Micz FlorMicz Flor
    Posts: 184Administrator
    hi andel,

    the template reference guide is in the wiki:
    http://wiki.sourcefabric.org/display/NsLingo/List+of+Article s

    but i can not find an example in the page. and i don't have an answer myself right now. would be great if you could test it and if you find a way, mail it here, i put it in the wiki.

    i will also try to get my hands dirty asap.

    all the best, micz
  • Vote Up0Vote Down AndelAndel
    Posts: 95Member
    Hi Micz,

    I've tried everything I could think of, no luck so far. That's why I am asking, usually hit and miss works eventually, but not this time.

    Cheers, Andel
  • Maybe you can try different approach, constraints="type not xyz", if it can
    fit your needs

    On 25 March 2011 18:22, Andel <newscoop-support@lists.sourcefabric.org>wrote:

    > Hi Micz,
    >
    > I've tried everything I could think of, no luck so far. That's why I am
    > asking, usually hit and miss works eventually, but not this time.
    >
    > Cheers, Andel
    >

    --
    Ljuba Rankovic
    Senior Front End Developer, Sourcefabric
    ljuba.rankovic@sourcefabric.org

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric
  • You can only use one "type is" constraint:
    {{ list_article constraints="type is xyz" }}

    Using more "type is" constraints will return an empty list. What will work
    though is:
    {{ list_article constraints="type not a type not b type not c" }}
    and you can list the types you're not interested in.

    I also created this bug which will be fixed in the next version:
    http://dev.sourcefabric.org/browse/CS-2972

    Mugur Rus
    Senior Software Developer, Sourcefabric
    mugur.rus@sourcefabric.org

    Cluj-Napoca, Romania
    +40 (0)720 528408
    Skype: mugur_rus

    http://www.sourcefabric.org
    http://www.twitter.com/Sourcefabric



    On Fri, Mar 25, 2011 at 6:56 PM, Andel <
    newscoop-support@lists.sourcefabric.org> wrote:

    > Hi again,
    >
    > I *did* read the manual and template guide and can't find an answer for
    > this question. If I simply add a "type is xyz" (e.g. constraints="type is
    > news type is xyz") nothing at all gets shown. So obviously the most logic
    > way doesn't work. So please, what will work?
    >
    > Cheers,
    >
    > Andel
    >