Question

I wanted to know what is the right syntax on a conditional statement way to check if a Resource used is static or Document? I have a single template that can be used with 2 different types of resource.

So the conditional statement might be like this:

[[+template:is=static:then=This is static resource:else=This is document resource]]

Anyone knows how to do it in MODx? I'm using MODx revolution latest version.

Thanks :)

Était-ce utile?

La solution

you want to check the [[*class_key]] variable of the resource in question.

[[+class_key:is='modDocument':then='This is document resource']]

you also have modWebLink & modSymLink, I don't know what the static resource is ~ at a guess modStatic?

Autres conseils

this is coming a lot later but just for the benefit of those that may come along later, the key for static resource is modStaticResource.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top