Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-01-14 11:34:03

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,181

Re: how to calculate custom_fields of articles

Thanks, Oleg.

These amendments deserved being reflected in the docs: Currently, the if_cf page states that tag is a container tag only and the application as 1/0 test isn’t there, either. The code example might well be taken from your post, I think.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#12 2019-01-14 15:45:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,611
Website

Re: how to calculate custom_fields of articles

uli wrote #316109:

These amendments deserved being reflected in the docs

I’ve added the example and mentioned use as a single tag. Good catch, thanks Uli.

EDIT: this is actually the case for all (at least most?) conditional tags now: they can be used as a single as of 4.7.0, so we should probably update the docs accordingly for all of them.

Last edited by Bloke (2019-01-14 15:51:22)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#13 2019-01-14 20:17:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,107
Website

Re: how to calculate custom_fields of articles

Bloke wrote #316121:

I’ve added the example and mentioned use as a single tag. Good catch, thanks Uli.

I think that the way Oleg described it, the counter variable only works when enclosed in an article (or article_custom) loop. Changed the description, slightly.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#14 2019-01-14 22:55:14

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,611
Website

Re: how to calculate custom_fields of articles

Good call, colak, thanks. I made it even more explicit by enclosing the example in a <txp:if_individual_article> container, and also added the 4.7.0 genealogy section. That needs to be done for all the single conditional tags mentioned in this commit (which isn’t all of them: some of the if_first_* and if_last_* tags have been omitted, for example, though they may have been done in a later commit).


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB