Zjištění podtypu identifikátoru stránky
Rozhraní com.etnetera.jnp.publish.PageIdentification
definuje statické prvky AK_UNSTABLE
apod.
Třída každého identifikátoru stránky (jejíž instancí je také objekt tgt
) toto rozhraní implementuje, proto tedy lze použít tgt.class.AK_UNSTABLE
apod.
Fragmenty kódu
Import třídy
{import com.etnetera.jnp.publish.PageIdentification}
{let tgt := target(_asset, "target")}
<a href="{tgt}">
{if or(tgt.addressKind == PageIdentification.AK_UNSTABLE,
tgt.addressKind == PageIdentification.AK_FILE)}
stáhnout
{else}
více
{/if}
</a>
Přístup k podhodnotám třídy
{let tgt := target(_asset, "target")}
<a href="{tgt}">
{if or(tgt.addressKind == tgt.class.AK_UNSTABLE,
tgt.addressKind == tgt.class.AK_FILE)}
stáhnout
{else}
více
{/if}
</a>