문제

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 :)

도움이 되었습니까?

해결책

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?

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top