Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2018-11-07 15:07:56

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [solved] Nth year counter from given start

etc wrote #315040:

<!-- get the latest issue -->...

That’s the winner! ?

Thread marked as solved.

But one related question. I think it would be useful in my case to have a column in the Articles panel to show the CF ‘issue’ field, thus quickly see what articles have which issue numbers, or are missing any. How can I hack that easiest?

Offline

#38 2018-11-07 15:25:14

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

Re: [solved] Nth year counter from given start

etc wrote #315040:

<!— get the latest issue —>
<!— add sort=“issue DESC” to article_custom if “latest” means “issue number”, not “date” —>
<txp:variable name=“latest” escape=“trim”>
<txp:article_custom limit=“1”>
<txp:custom_field name=“issue” />
</txp:article_custom>
</txp:variable>

<!— retrieve the latest articles —>
<txp:article_custom issue=’<txp:variable name=“latest” />’ form=“current_issue_list” />

Yup, that was sort of what I was thinking but you’ve done it in two steps – look up the issue, then output just that issue – which is more legible. And nice and simple. No need to save on db-queries here with so few articles.


TXP Builders – finely-crafted code, design and txp

Offline

#39 2018-11-07 15:32:55

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

Re: [solved] Nth year counter from given start

Destry wrote #315043:

The stories aren’t going anywhere. … Again, I think you misunderstood. The stories are still there, just not the concept of an ‘issue’.

I did, sorry. Glad they’ll still be there.

You found those? I was not planning to republish those. I read them a while ago and they just sounded really outdated against the state of play today.

There’s a half-complete article in the textpattern docs and it made me think: “didn’t you already describe that all once before?” so I went in search of them (they are on the Way Back Machine but I had to google what they were called first in order to find them). You’re right, they’re no longer up to date but they did help a lot of people at the time. Lot’s of complementary comments to your article.

But one related question. I think it would be useful in my case to have a column in the Articles panel to show the CF ‘issue’ field, thus quickly see what articles have which issue numbers, or are missing any. How can I hack that easiest?

I’d like to know that, too. In the past, for a painter’s site, I wanted the article images to show in the article list and had to hack txp_list.php to achieve it.

Short of that, you could conceivably use sections for the issues instead of a custom field, especially as you’re using just a domain.com/title url scheme. Then you’d see them in the admin area and outputting the start page and the archives would be very simple.


TXP Builders – finely-crafted code, design and txp

Offline

#40 2018-11-07 15:48:24

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

Re: [solved] Nth year counter from given start

Destry wrote #315045:

I think it would be useful in my case to have a column in the Articles panel to show the CF ‘issue’ field, thus quickly see what articles have which issue numbers, or are missing any.

Use adi_matrix for sure. Create yourself a custom Matrix to appear on the Articles panel that shows the article title, Issue custom field, Published status and any other salient fields, then view that new panel. You’ll get all articles showing up with their issue numbers in one place. And the kicker? You can change as much as you want and update all articles at once with a single click on the Save button. It’s a blindingly good plugin.


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

#41 2018-11-07 16:17:31

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

Re: [solved] Nth year counter from given start

Destry wrote #315041:

I know Bloke did no small amount of magic just to get TXP Mag operating more like a real magazing, at least on the organizational side.

It was fun. But to be fair, Textpattern has most of the elements already, they just needed tying to the URL because of the custom formats we wanted:

  • txpmag.com/issues = all issues list, latest first.
  • txpmag.com/issues/N = issue N landing page
  • txpmag.com/issues/YEAR = latest issue from that year
  • txpmag.com/issues/YEAR/MO = issue from that year and month
  • txpmag.com/people/your-name = person bio + articles they authored + sidebar showing latest issue articles

Most of it was handled from a single “routing” Form that’s included at the top of every page. That analyses the URL and makes a bunch of decisions to work out which of the above ‘contexts’ apply and then sets variables accordingly.

After that, each structural element – sidebar, main copy, etc – uses conditionals to display the relevant content based on the variables that have been set.

The rest of the article stuff works as standard Textpattern. Built-in magic :)

btw, there’s a mag article on it :)

if I was building a CMS today, it would be specifically for editorial publishing and workflow, not website design in general.

My status-mods branch is one such experiment into this arena. No implied hierarchical publishing statuses. Each status is in one of two default camps: either ‘published’ or ‘unpublished’ and then you (or plugins) can rewire each as you like, or make more statuses and groups.

In this brave new world, there’s nothing to stop a plugin from registering new statuses or repurposing Pending as “Intent to publish”. With some smd_bio goodness, said publishing workflow plugin could even ping someone with an ‘editor’ role to notify them it’s ready for review. Or whatever.

The posts garnered zero interest so I assumed it was not of use (or too Blokey-terse to understand!)

Last edited by Bloke (2018-11-07 16:40:13)


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

#42 2018-11-07 18:09:58

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [solved] Nth year counter from given start

Bloke wrote #315049:

there’s a mag article on it :)

Thank you for the deserved reminder about the article I probably reviewed!

When the server kinks are ironed out with the mag’s admin-side so things are working properly again (e.g. macros), I’ll have another look at it all. I’ve been in this pressed for time/losing sleep cycle lately and it’s not been doing me well. I apologize for my ignorance and forgetfulness of history. My wife says I am losing my mind. She might be right. And now I’m singing Billy Joel.

The posts garnered zero interest so I assumed it was not of use (or too Blokey-terse to understand!)

I guess I missed that one. ‘But what does it all mean, Basil?’

Offline

#43 2018-11-07 18:14:15

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [solved] Nth year counter from given start

Bloke wrote #315048:

Use adi_matrix for sure.

Cool. Thanks.

Offline

#44 2018-11-07 18:22:38

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

Re: [solved] Nth year counter from given start

Destry wrote #315054:

‘But what does it all mean, Basil?’

  1. Txp’s publishing statuses are rigid and their meaning cannot be changed.
  2. There is an implied hierarchy: Draft < Hidden < Pending < Live < Sticky
  3. There are two ‘groups’ of status: Published (Live and Sticky), Unpublished (everything else).
  4. In numerous places in the code, the above paradigm is enforced.

This is limiting. I’m seeking to open this up so there is:

  • The ability to make your own status values.
  • No implied hierarchy.
  • The ability to make your own status groups and assign one or more statuses to them (Default: 2 groups, as it is today).
  • No enforced knowledge in the code of “status x is greater than status y”. Everything is done on the basis of a) which group it is in, and b) the order in which the statuses are configured in that group.

Game on for plugins to play and completely rip up the publishing paradigm.

Last edited by Bloke (2018-11-07 18:23:53)


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