2

I'm working on an existing site that has an "Entries" field that allows authors to provide a selection of related articles. However, since some articles have titles whose meaning is not entirely clear in this different context, the client would like to be able to tweak the wording of the titles in this "related articles" context.

The best way I can see to do this would be to make the "Related articles" field a Matrix, with each block containing both an entry and an alternative title. However, this is an existing site with lots of posts that already use this field, so I'd need to somehow convert the existing "Entries" field to a Matrix. Is this possible at all?

(I realise that an alternative approach would be to add a "Short title" field to entries. However, UX-wise this feels awkward compared to the Matrix approach, since it would require the editor to also potentially edit each of the related articles, which is both more long-winded and less clear as a process)

  • 1
    You're probably aware of this feature, but just to make sure – since Craft 2.0.2524 its possible to double-click on any entry selected in an Entries field, which will bring up an editor modal for that entry. If you add a "Short title" field to the top of your entry type's field layout, I don't really see how this approach would be significantly more awkward or much less efficient than using Matrix. – Mats Mikkel Rummelhoff Mar 8 '16 at 19:14
  • I actually wasn't aware of that feature! Very useful to know - thanks! (And yes, you're right - that probably does make the alternative approach totally viable...) – Nick F Mar 9 '16 at 15:03
2

Unless each time an Entry is selected the name needs to be different (to other times that same Entry is chosen), then I would suggest using your latter approach of adding an secondary Title field as it would be more efficient in the long term because the secondary Title would only need to be added once.

If it's about an Entry, consider keeping it 'with' the Entry.

I use a similar approach for Meta Titles to override the Entry title for SEO purposes.

  • Thanks for the reply. I agree, for metadata that's definitely the best approach. In this case though - apart from the potentially slightly awkward UX thing - the "Related articles" field can be displayed in various ways (the user has control over whether it's a small aside that appears in the margin or whether it's the full width of the article). So it's quite possible that the context might affect when / whether they want to tweak the article title. The "keep it with the entry" approach is my fallback, but my question is really about whether there's any way to convert the field type... – Nick F Mar 8 '16 at 18:44
  • @NickF A crazy idea, but could work: Add both titles to your HTML, and use element queries to set display: none; on one or the other, depending on the entry container's width. – Mats Mikkel Rummelhoff Mar 8 '16 at 19:17
  • @NickF fair point – Matt P Mar 8 '16 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.