Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2014-03-18 14:33:24

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

Re: [Solved] Extract custom field contents from next and prev articles

etc wrote #279789:

Note however, that some_name has not to be a cf name, <txp:custom_field name="article_image" /> works as well.

That one almost had me doubting what I’d understood so far. But a look at the textpattern table showed me that the supposed “article_image” column in actual fact is named “Image”. And this previous, incorrect, assumption explains some of the ripples I made in this topic. Sorry.

Thanks for clarifying all this, Oleg.


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

Offline

#14 2014-03-18 15:30:33

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

Re: [Solved] Extract custom field contents from next and prev articles

uli wrote #279808:

But a look at the textpattern table showed me that the supposed “article_image” column in actual fact is named “Image”.

You are right, Uli, it is article_column_map function (called by <txp:article />) that renames it to article_image (and also ID to thisid, etc).

Re future, Stef seems incline to preserve this <txp:custom_field /> feature.

Offline

#15 2014-03-18 15:32:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: [Solved] Extract custom field contents from next and prev articles

uli wrote #279808:

a look at the textpattern table showed me that the supposed “article_image” column in actual fact is named “Image”

Yeah, things like that can be a trifle annoying. Would be grand if the database column names were a) consistent (in terms of case / underscores), b) sensibly-named, c) matched our internal variables. But, meh, keeps us all on our toes :-)


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

#16 2014-03-18 15:34:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: [Solved] Extract custom field contents from next and prev articles

etc wrote #279809:

Re future, Stef seems incline to preserve this <txp:custom_field /> feature.

Only because there’s currently no replacement mechanism available, and direct access to $thisarticle is very handy for those tags (such as article_image) that otherwise make too many assumptions and return formatted content.

Yes, it’s an undocumented feature and a failing of our use of globals / sanitization. But until we have something better in place, it’ll stay.


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