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: 7,537
Website

[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.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,662
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: 3,530
Website

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: 7,537
Website

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.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

Board footer

Powered by FluxBB