Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#41 2020-06-27 05:15:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,297
Website

Re: Bibliography management

I just thought that you can achieve the above using articles and custom fields in a headless section.
ie.

Data type Txp field Plugin field Write Tab
Author(s) [author] CF 1
Article title [title] Title field
Source [description] Body field
Edition [edition] CF 2
Editor(s) [editor] CF 3
Volume(s) [volume] CF 4
City [city] CF 5
Year [yyyy] CF 6
Type [type] CF 7
URL [url] CF 8
Accessed [date] Posted date

> Edited to add that you may even use article_image to include a picture of the publication (if appropriate).

Last edited by colak (2020-06-27 07:26:30)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#42 2020-06-27 06:55:53

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,946
Website

Re: Bibliography management

colak wrote #324038:

I just thought that you can achieve the above using articles and custom fields in a headless section.

I’d tend to agree with you. What Destry describes sounds like a whole new content type and if you (Destry) are not already using articles and want to avoid overlap, then you’re likely to get more flexibility out of txp:article and txp:article_custom than txp:linklist. You may not even need to assign them to a ‘pageless’ section if you’re displaying them anyway.

But, you’re welcome to try out the multiple field version of jcr_link_custom. Currently it gives you up to five extra fields, but it could be expanded easily to more.

The level of granularity you need depends firstly on whether you intend to slice-and-dice your output based on those different fields and possibly also on the styling or markup you might want to apply to the individual items. If three items will always be displayed together (in future too) and you don’t need to mark them up differently bar simple italicising or spans, then you can use textile in the respective field.


TXP Builders – finely-crafted code, design and txp

Offline

#43 2020-06-27 07:22:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,792
Website

Re: Bibliography management

Destry wrote #324036:

the way I see it, Links (the panel) was conceived by Dean with blogrolls in mind… and the Links panel has never been reinvented in response.

Agreed.

even the Time Stamp would need to be conditional in my case.

Since null dates are not permitted in SQL, we have no choice here. But there is a workaround, in a way. If you set any dates that you don’t want to a known-past date, say “1970-01-01 00:00:00” (which is treated as ‘zero’ in the epoch counting system) then you can detect that situation using something like this (untested):

<txp:evaluate query='<txp:link_date format="%s" /> > 0'>The date is used!</txp:evaluate>

Bit of a hack, and annoying that if you don’t want to use something you have to explicitly set it, which is counter-intuitive, but such is the nature of the system we’re working in at present.

if I could turn [the Title] column off in the Column Display Options

Just sort the table by a different column by clicking another heading, then you can turn it off. We don’t allow you to turn off the currently-in-use sort key as that breaks things.

combined with a plugin that augments the fields

Unlimited core custom fields can be used for all content types. They’ll be here. I promise.

Last edited by Bloke (2020-06-27 07:24:38)


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

#44 2020-06-27 09:24:49

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

Re: Bibliography management

colak wrote #324038:

you can achieve the above using articles and custom fields

Destry wrote #323908:

I do not want to Frankenstein a bibliography out of articles. Trying to make better use of links [panel] here, is the point.

Rather, Frankenstein the otherwise needless Links panel instead. ;)

The thing is, I’ve never liked having to use Articles for any content that isn’t already article-based. They don’t have to be ‘blog’ articles, per se, but there should be at least one component of the content item that is a multi-sentenced paragraph meant to be read like prose. Citations are not that. It just doesn’t look or feel right in the backend to mix data-oriented content types with article-based content types. And I am using citations in purely academic style, so no gratuitous elements like images and whatnot are added.

If that’s still too abstract, here’s another way I typically distinguish the two categories of types (article-based and data-oriented): article-based will mostly rely on textarea fields for the bulk of the text volume. Data-oriented will typically only rely text fields, with Description fields often being the one exception, as they are here.

Even when unlimited custom fields come along to create more article-based content types (how I would use it), I would not use the Articles panel for creating data-oriented types.

So in my case with bibliographies, either I find an acceptable compromising hack scenario using Links panel (otherwise not used at all), or I more painstakingly edit the master bibliography as a whole list in a single article, and subset lists at bottoms of main articles. More blob fodder in the Body blob field, but that’s what it would take.

Which leads me to clarify with Bloke…

Bloke wrote #324040:

Unlimited core custom fields can be used for all content types. They’ll be here. I promise.

‘for all content types’… You’re saying I would be able to use UCFs on the Links panel? If so, then problem solved. I’ll use Jakob’s plugin in combination with Link fields in the meantime, and redo it with UCFs when they land.

But if you’re still just talking about Article UCFs, then nothing changes for me, as I tried to explain above. In this case, I’d still keep using Jakob’s plugin, or write the bibliography as whole lists, because I would not want citation items sitting in the Articles panel with article items. They just don’t belong mixed together in my sense of organization. Sure, it can be done, but it doesn’t make sense to me…

Unless with UCFs we could also pull out a given type of article items (e.g. citations) and display them in their own Content panel (e.g. Citations); a custom panel composed of a sublist of articles. You could still see them in the Article table too, I guess, since that’s where they were created, but you wouldn’t have to access them that way. Easier by the custom panel that filters the specific items out. I guess you could then edit a given item by either panel, but 9 out of 10 times one would use the dedicated custom panel for working with existing items. That would change things for me when it came to custom content types. But I haven’t been keeping up with the plan there.

set dates you don’t want to a known past date, say “1970-01-01 00:00:00” (which is treated as ‘zero’ in the epoch counting system) then you can detect that situation using something like this (untested): <txp:evaluate query='<txp:link_date format="%s" /> > 0'>The date is used!</txp:evaluate>.... Bit of a hack, and annoying that if you don’t want to use something you have to explicitly set it, which is counter-intuitive, but such is the nature of the system we’re working in at present.

Noted. Thanks. I think it’s a moot issue now with Jakob’s augmented plugin.

Sort the table by a different column by clicking another heading, then you can turn it off.

Ha. I never paid attention to that fact before.

Last edited by Destry (2020-06-27 09:40:27)

Offline

#45 2020-06-27 10:05:59

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

Re: Bibliography management

jakob wrote #324039:

you’re welcome to try out the multiple field version of jcr_link_custom.

Is this the right location for the multi-field, jcr_link_custom? Still says updated ’4 years’ ago.

Offline

#46 2020-06-27 11:58:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,792
Website

Re: Bibliography management

Destry wrote #324047:

The thing is, I’ve never liked having to use Articles for any content that isn’t already _article_-based.

I agree. Use articles where it makes sense. The other types are there for your (ab)use where they’re more appropriate, and maybe in some far off distant utopia, custom types without the headache of spending aeons defining them from scratch.

‘for all content types’… You’re saying I would be able to use UCFs on the Links panel?

Yes. UCF has been designed from the ground up to add custom fields to all or any content types. This includes:

  • Articles
  • Files
  • Images
  • Links
  • Categories
  • Sections (will require a little table tweak as they don’t have IDs at the moment)
  • Authors (goodbye smd_bio!)
  • Third-party plugins (yes, there’s nothing to stop plugin authors registering their own fields as it’s just a linking system – internally in code, it’s known as The Meta Store. That’s primarily because ‘custom fields’ has already been taken in code, so we needed something else. But also because it’s really just a way to add structured, augmented metadata to anything you can lay your hands on).

As long as the tables they’re linking to have IDs, custom fields can be defined and attached to anything. And if a plugin adds their own, (e.g. custom content type) then the field definitions could be managed from the Admin->Custom Fields panel. Though I am considering the ability to specify some sort of field visibility in case a plugin wants to make them uneditable from the admin side – still thinking about this.

Last edited by Bloke (2020-06-27 12:03:14)


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

#47 2020-06-27 17:04:52

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,946
Website

Re: Bibliography management

Destry wrote #324048:

Is this the right location for the multi-field, jcr_link_custom? Still says updated ’4 years’ ago.

(Sorry, was out all day)

That’s the original 1cf version. You just need to switch to the “multiple fields” branch: direct link

I made a few small updates that migrate the settings from the earlier plugin without you having to set the custom field name. As with the article cfs it’s called “custom1” to begin with but you can rename it.

See the section in the docs for giving them your own name in the links panel.


TXP Builders – finely-crafted code, design and txp

Offline

#48 2020-06-27 17:12:41

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

Re: Bibliography management

Bloke, that all sounds fab. Bibliography solved, then. Will evolve it as abilities arrive.

jakob wrote #324058:

You just need to switch to the “multiple fields” branch: direct link

Zut, you had mentioned that before. Sorry.

Thanks a lot for extending the plugin.

Offline

#49 2020-06-27 21:15:58

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

Re: Bibliography management

Bloke wrote #324040:

If you set any dates that you don’t want to a known-past date, say “1970-01-01 00:00:00” (which is treated as ‘zero’ in the epoch counting system) then you can detect that situation

I decided to give it try, because if it works, it makes use of a core field and frees up one from the plugin. I’m not sure it’s working though, I tried it as you gave…

<txp:evaluate query='<txp:link_date format="%s" /> > 0'>The date is used!</txp:evaluate>

That was just outputting ‘The date is used!’ whether it’s epoch zero or not. But then, after double checking the date I entered, I noticed that when changing to 1970-01-01 00:00:00 and saving, then going back to look at the link in edit mode again, the date returned to what it was before trying to change it. Doesn’t matter what date I try in the past. I’m still using 4.8.0 at the moment, but that sounds like a bug.

…snipped from here; need to think it through better…

Last edited by Destry (2020-06-27 21:28:59)

Offline

#50 2020-06-27 21:52:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,792
Website

Re: Bibliography management

Destry wrote #324065:

Doesn’t matter what date I try in the past.

That is weird. You’re right that using 1970-01-01 00:00:00 fails. That’s a bug and I’ll fix it, likely due to testing empty() and PHP thinks that ‘0’ is empty. Nope, it’s in the link_save() function of txp_link.php. There’s a line in there that should read:

if (!$publish_now && $created_ts >= 0) {
...

But even without that fix, if I use 1970-01-01 00:00:01 (i.e. 1 second after the epoch) then it lets me store it just fine. And in that case, the test in the <txp:evaluate> tag will be > 1.

I am using 4.8.1 though. Don’t think there’s any difference between 4.8.0 and 4.8.1 in the Links domain, but I might be wrong.

Last edited by Bloke (2020-06-27 21:57:37)


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