Skip Navigation

[Resolved] Custom field/taxonomy for authors with first name and last name

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 10 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by ochado 10 years, 3 months ago.

Assisted by: Caridad.

Author
Posts
#183648

On my website, I have a CPT for academic research publications. I want to include the authors as a taxonomy or field item. The easiest way to do this in Types would probably be as a single-line text field that allows multiple instances, since most publications have multiple authors. However, this approach doesn't permit me to do two things I would like to do:

* I want to distinguish between the author's first name and last name. (Middle names or anything else would be part of the first name subfield.) Specifically, I would normally display the author's name as first-name last-name, but in a few places I would want to display some authors' names as "Last-name, First-name"; I would even like to mix and match, such as when a publication is cited as "Lastname1, Firstname1, Firstname2 Lastname2, Firstname3 Lastname3". Moreover, whenever listing authors, I would want to sort by last name, even if the display is in the "Firstname Lastname" format. I want to use a custom structure that would give me this flexibility.

* I would like to easily list all publications for an author, and so take advantage of built-in and semiautomatic functions, such as archive pages.

Here are my considerations of possible solutions:

* Custom field: This was my first attempt, as mentioned above. Although Types permits me to set up multi-instance fields, I cannot figure out how to separate an author name into first name and last name subfields. Moreover, custom fields don't give any semiautomatic display options such as archive pages.

* Custom taxonomy: This has the advantage of easy archive pages, but like a custom field, I don't see how I can easily separate an author name into first name and last name subfields.

* Custom post type: If I were to create a publication_author CPT with a child relationship to research_publication, I could then set up custom fields for first and last name and have maximum display and archive flexibility. However, I really think this is overkill. The only things I want to store about an author are their first name and last name as separate subfields, nothing else. An entire CPT for just that would probably be more trouble than it's worth, with lots of unnecessary overhead.

Based on these considerations, could you please tell me how I could use Types to create the structure I need? I would ideally like to use a custom taxonomy, but I don't know how to configure it to meet my needs.

#184313

Dear Chitu,

The only way that you can have separate fields is to create a separate custom post type. But there is one problem that you dont mention, this way you can only select one author per publication.

You need a many-to-many relationship between publications and authors. This is done by creating an intermediary custom post type. This is better explained here:

https://toolset.com/faq/how-do-i-associate-one-child-with-several-parents-of-the-same-type/

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad

#184581

Aye-aye-aye! This is a major relational database modeling case!

Your response is not what I wanted to hear, but it is defintely what I need. OK, that's definitely overkill for my purposes.

Since my main two purposes are 1) listing all authors in very particular orders; and 2) having built-in features for grouping publications by author, I will end up using both a custom field and a custom taxonomy:

* Custom field "Author list": single-line field in format "Lastname1, Firstname1, Firstname2 Lastname2, Firstname3 Lastname3"
* Custom taxonomy (non-hierarchical) "Publication author": format "Firstname Lastname"

Whenever I need to display the author list in my desired format and whenever I want to sort publications by author, I'll use the "Author list" custom field; whenever I want to list all publications by a particular author, I'll use the "Publication author" custom taxonomy.

Thanks for your help in clarifying my possibilities!

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.