backdropcms.org icon indicating copy to clipboard operation
backdropcms.org copied to clipboard

Add a "quotes" multi-value text field in the external mentions content type.

Open klonos opened this issue 2 years ago • 9 comments

This came up in a thread in Zulip, where we were discussing the mentions to Backdrop in the recent Dries Q&A session in DrupalCon Pittsburg:

@keiserjb

Watching/listening the Driesnot Q and A for the Backdrop question that is supposed to be there. Will report.

Question is at 36:05. Backdrop is a "friendly fork" and has been a "net positive for Drupal." "Backdrop might be a great solution," for organizations that cannot move to Drupal 10 or 11.

@cellear

Could we get away with putting this quote on our home page?

@klonos

What we can surely do is add a "quotes" field in our external mentions content type, so that when we are adding links to videos/podcasts, we can include these (which will be equally useful for non-video, textual external mentions too).

klonos avatar Jun 19 '23 08:06 klonos

These are the current fields for that content type:

image

So this addition would presumably be something like:

  • Title: Quote
  • Machine name: field_mention_quote
  • Field type: Text (long)

Sound OK?

We need to give attribution for the quote. There is an existing "Link to author(s)" field, but what if the author isn't linkable? Should we also have a field_mention_quote_attribution textfield?

Anything else? Other suggestions on the details of implementation?

bugfolder avatar Jun 19 '23 15:06 bugfolder

Sound OK?

I was thinking that this should be a multi-value field, in case there may be multiple quotes in the same source that we'd like to add. So field_mention_quotes? (plural)

...but what if the author isn't linkable?

Link fields allow for an "Optional URL" setting, which is enabled for the current "Link to author(s)" field, and which allows to add an author name w/o a link to it. We can do the same for the new "Link to quoter" field (in the case of videos or podcasts, the person that makes the quote might not be the author/owner of the site/platform where the mention was published).

klonos avatar Jun 19 '23 17:06 klonos

So on the "Link to quoter" field, we want a "Required Title" (because all quotes should be attributed) but an "Optional URL" (because there may not be a link to the person being quoted).

And I'm assuming that the "Link to quoter" field only allows one entry, right? In a single "External mention", a single person can give multiple quotes. But trying to allow multiple people giving multiple quotes via a single External Mention seems problematic.

[EDIT] If the URL is optional, then that field should be called just "Quoter" (or something like it) since it isn't necessarily a link.

bugfolder avatar Jun 19 '23 21:06 bugfolder

Here's what the two fields mentioned above would look like on the "Create External mention" page:

image

bugfolder avatar Jun 19 '23 21:06 bugfolder

This looks great, but can we change the label from "Quoter" to "Quote author"? :)

Let's also make sure this field is hidden on the node view displays (since we will be pulling them out via a view instead)

jenlampton avatar Jun 20 '23 19:06 jenlampton

That's done. Fields are added to the content type, but hidden on the default display.

bugfolder avatar Jun 20 '23 22:06 bugfolder

I was going to close this issue (since the fields are now added) and link to an example for reference. One such example is https://backdropcms.org/node/5012/edit.

But then I noticed that although we give the verbal instruction "If you include a quote, you must give attribution in the "Quote author" field following," in that example, that quote doesn't have attribution in the "Quote author" field.

Which makes me wonder if we need to add some conditional validation to the node edit form: if the "Quote(s)" field is non-empty, make the "Quote author" field required. @jenlampton, @klonos?

bugfolder avatar Jul 13 '23 14:07 bugfolder

@klonos, @yorkshire-pudding, I've created a PR https://github.com/backdrop-ops/backdropcms.org/pull/1011 that adds validation to the quote author field if a quote is present.

bugfolder avatar Aug 03 '23 16:08 bugfolder

@bugfolder - I don't have a way to test it, but comparing the code to the elements on the page, it looks good.

yorkshire-pudding avatar Aug 03 '23 16:08 yorkshire-pudding