Ensure RSS is discoverable from home page #220

Open
opened 2020-05-25 16:35:14 +00:00 by mlncn · 3 comments
mlncn commented 2020-05-25 16:35:14 +00:00 (Migrated from gitlab.com)

We have RSS but an RSS reader or browser plugin wouldn't likely find it given our home page because we don't announce it in a machine-readable way. (Want My RSS for instance does not add the RSS icon to the addressbar for Agaric.coop but does for Drupal.org/planet

Planet Drupal includes this in its HTML <head> section:

<link rel="alternate" type="application/rss+xml" title="Drupal.org aggregator - Planet Drupal" href="https://www.drupal.org/planet/rss.xml" />

Do this for NICHQ.org first and bill to NICHQ Support 2020.

We have RSS but an RSS reader or browser plugin wouldn't likely find it given our home page because we don't announce it in a machine-readable way. ([Want My RSS](https://github.com/Reeywhaar/want-my-rss) for instance does not add the RSS icon to the addressbar for Agaric.coop but does for Drupal.org/planet [Planet Drupal](https://www.drupal.org/planet) includes this in its HTML `<head>` section: `<link rel="alternate" type="application/rss+xml" title="Drupal.org aggregator - Planet Drupal" href="https://www.drupal.org/planet/rss.xml" />` Do this for [NICHQ.org](https://gitlab.com/nichq/nichq-org/-/issues) first and bill to NICHQ Support 2020.
mlncn commented 2020-05-25 17:08:59 +00:00 (Migrated from gitlab.com)

As a followup, https://agaric.coop/rss needs love. And it should get the same metadata.

As a followup, https://agaric.coop/rss needs love. And it should get the same metadata.
mlncn commented 2020-05-25 17:12:20 +00:00 (Migrated from gitlab.com)

Oh we need the blog page to do the same RSS metadata.

I would like this added metadata done in a contrib module, if none exist to do this already. Maybe it's just configuration for the meta tag module but both the discoverability for machines and the page to explain what the heck RSS is should be something that is automatic for sites— maybe only really practical as a Drutopia feature where some information about relevant RSS feeds is already known.

Oh we need the blog page to do the same RSS metadata. I would like this added metadata done in a contrib module, if none exist to do this already. Maybe it's just configuration for the meta tag module but both the discoverability for machines and the page to explain what the heck RSS is should be something that is automatic for sites— maybe only really practical as a Drutopia feature where some information about relevant RSS feeds is already known.
gnuget commented 2020-05-26 00:17:37 +00:00 (Migrated from gitlab.com)

I reviewed how drupal does this out of the box:

The RSS is generated in Drupal using Views, by default there is a view called /node and that view has a display called /rss.xml which displays the same info as /node but in an RSS format.

https://agaric-coop.ddev.site/admin/structure/views/view/frontpage/edit/feed_1

In the Feed display we can select if we want to display the link to add the RSS icon in the browser using the Attach to option in the view:

image

The only options to display the icon there is the Feed display and the master view:

image

Usually out of the box drupal displays the RSS icon on the homepage because the default home for drupal is /node once a different home is set to a different page the icon disappears.

What I did to display the icon in NICHQ was add a hook in the code letting Drupal know that we want to display the RSS icon in all our pages like this:

/**
 * Implements hook_page_attachments().
 */
function nichq_page_attachments(array &$attachments) {
  $host = \Drupal::request()->getSchemeAndHttpHost();
  $attachments['#attached']['feed'][] = [$host . '/rss.xml'];
}

That adds the attachment in all the pages and we can have the icon on the whole site.

In the case of our site, we have more than one Feed so, here we need to decide which feed we want to link in the icon, my guess is that we want to link our blog?

I mean this one:

http://agaric-coop.ddev.site/blog/feed

is this correct?

Not sure if we should create a module for this in contrib or create a patch for the Metatag module or just create a blog post letting the users know how this works in Drupal.

What do you think?

I reviewed how drupal does this out of the box: The RSS is generated in Drupal using Views, by default there is a view called `/node` and that view has a display called `/rss.xml` which displays the same info as `/node` but in an RSS format. https://agaric-coop.ddev.site/admin/structure/views/view/frontpage/edit/feed_1 In the Feed display we can select if we want to display the `link` to add the RSS icon in the browser using the `Attach to` option in the view: ![image](/uploads/110a7147cb3551116ffc2af404260088/image.png) The only options to display the icon there is the Feed display and the master view: ![image](/uploads/46c25dd681d274dcb00ced8a502ad765/image.png) Usually out of the box drupal displays the RSS icon on the homepage because the default home for drupal is `/node` once a different home is set to a different page the icon disappears. What I did to display the icon in NICHQ was add a hook in the code letting Drupal know that we want to display the RSS icon in all our pages like this: ```php /** * Implements hook_page_attachments(). */ function nichq_page_attachments(array &$attachments) { $host = \Drupal::request()->getSchemeAndHttpHost(); $attachments['#attached']['feed'][] = [$host . '/rss.xml']; } ``` That adds the attachment in all the pages and we can have the icon on the whole site. In the case of our site, we have more than one Feed so, here we need to decide which feed we want to link in the icon, my guess is that we want to link our blog? I mean this one: http://agaric-coop.ddev.site/blog/feed is this correct? Not sure if we should create a module for this in contrib or create a patch for the Metatag module or just create a blog post letting the users know how this works in Drupal. What do you think?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: agaric/agaric-coop#220
No description provided.