Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-01-09 06:48:16

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

[Solved] detect when article is sticky

Is there a way to detect sticky articles in an article_custom context?

ie

<txp:article_custom status section='<txp:section>' category='<txp:category />' listform="my_listform" />

Example output I am trying to get from the my_listform:

<txp:posted />: <txp:permlink><txp:title /></txp:permlink>
<span class="sticky"><txp:posted />: <txp:permlink><txp:title /></txp:permlink></span>
<txp:posted />: <txp:permlink><txp:title /></txp:permlink>
<txp:posted />: <txp:permlink><txp:title /></txp:permlink>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2020-01-09 08:19:30

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: [Solved] detect when article is sticky

There’s wet_if_status but maybe this tip here works (Oleg’s tip borrowed from that thread):

<txp:if_custom_field name="status" value="5">
    <!-- sticky article -->
</txp:if_custom_field>

TXP Builders – finely-crafted code, design and txp

Offline

#3 2020-01-09 09:31:39

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: [Solved] detect when article is sticky

Here is the current list of article fields that can be extracted via <txp:custom_field /> (not formally supported):

annotate
article_image
authorid
body
category1
category2
comments_count
comments_invite
custom1
custom2
description
excerpt
expires
is_first
is_last
keywords
modified
override_form
posted
section
status
thisid
title
url_title

Offline

#4 2020-01-09 11:00:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: [Solved] detect when article is sticky

jakob wrote #320955:

There’s wet_if_status but maybe this tip here works (Oleg’s tip borrowed from that thread):

<txp:if_custom_field name="status" value="5">...

Thanks so much. That did it!

Also, many thanks to Oleg for listing the extra fields. It’ll be handy.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB