Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-04-28 19:45:16

worths1
Member
Registered: 2005-03-08
Posts: 18

Using custom field instead of sticky status

This post is related to a feature request I made about the sticky publication status. For reasons I lightly touched on in that post, I think the sticky publication status — at least as it is commonly used — doesn’t fit logically with the other statuses. I’d like to hide it (using CSS) and use a custom field called default (with the glz_custom_fields plugin) to accomplish the same thing.

To serve the section default article (i.e., what would be the latest sticky article), I think I can get it done with something like . . .

<txp:if_article_list>
   <txp:article default="1" listform="single" limit="1" />
<txp:else />
   <txp:article form="single" />
</txp:if_article_list>

Assuming this would work, is there a performance hit for doing this instead of using the sticky status? And if so, do you think it will be big?

Offline

#2 2014-04-29 10:33:58

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: Using custom field instead of sticky status

A drawback of your method: You will deal with some issues using certain plugins. For instance: IIRC you can not filter custom_fields in rah_sitemap, but sticky articles.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#3 2014-04-30 18:51:14

worths1
Member
Registered: 2005-03-08
Posts: 18

Re: Using custom field instead of sticky status

Thank you. I’ll run through the plugins I use to see if it causes a problem. (I do use rah_sitemap, but I don’t remember using it in a way that required filtering by pub status).

It occurred to me after this post that Textpattern performs custom field filtering all the time, so there really shouldn’t be a big performance hit. I just didn’t think it through.

So far, the reconfiguration seems to be working. I am using article categories to create something like WordPress’s page/post distinction, and I’m using smd_tags to recapture what I lose by limiting categories. Thus the “Sort and Display” box is recast as the place to indicate subject matter and type (i.e. page/post), while custom fields are used to set the article’s use, my term for indicating whether the article will be a section default, featured article, et al. Pub status is strictly about workflow which IMO is distinct from “Sticky.”

It’s cool that a simpleton like me can do this. It may be that this flexibility exists in other CMSs, but I wouldn’t imagine it would be even half as easy.

Offline

#4 2014-04-30 19:44:51

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Using custom field instead of sticky status

trenc wrote #280479:

you can not filter custom_fields in rah_sitemap, but sticky articles.

You can in rah_sitemap 1.3.0 that was released a month ago.

Offline

#5 2014-05-01 22:41:08

worths1
Member
Registered: 2005-03-08
Posts: 18

Re: Using custom field instead of sticky status

Looks like adi_menu uses sticky status for speaking blocks. Not a deal breaker.

Offline

Board footer

Powered by FluxBB