CMS Development

sanntn
Participante | Parceiro
Participante | Parceiro

Page publish state

resolver

Hi,

I'm wondering if there's a HubL filter for page publish state? Similar to the API filter state__in=PUBLISHED. So someething like {% if content.state.published = true %}

Thanks in advance.

1 Solução aceita
stefen
Solução
Conselheiro(a) de destaque | Parceiro
Conselheiro(a) de destaque | Parceiro

Page publish state

resolver

@sanntn you could probably just use the HubL variable {{ content.publish_date }} in an if statement. It will return a time object if it's published but if it's not should return false(y). E.g.: 

{% if content.publish_date %}
I'm published
{% else %}
I'm a draft
{% endif %}
Stefen Phelps, Community Champion, Kelp Web Developer

Exibir solução no post original

1 Resposta 1
stefen
Solução
Conselheiro(a) de destaque | Parceiro
Conselheiro(a) de destaque | Parceiro

Page publish state

resolver

@sanntn you could probably just use the HubL variable {{ content.publish_date }} in an if statement. It will return a time object if it's published but if it's not should return false(y). E.g.: 

{% if content.publish_date %}
I'm published
{% else %}
I'm a draft
{% endif %}
Stefen Phelps, Community Champion, Kelp Web Developer