CDR Tickets

Issue Number 5079
Summary Generate "In This Section" block for summaries
Created 2021-12-17 09:36:55
Issue Type Improvement
Submitted By Kline, Bob (NIH/NCI) [C]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2022-01-20 13:46:51
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.307120
Description

Currently the "In This Section" block for PDQ summaries on cancer.gov is generated by JavaScript running in the visitor's browser after the page is fetched. This practice has been found to have a negative affect on our SEO scores, so we want to move the generation of those blocks further upstream, creating them before the summaries are sent to Drupal. We considered three options:

  1. Add code to the existing XSL/T filter

  2. Add a new post-processing filter

  3. Add the blocks in cdrpub.py

The drawback of the first option is that not all of the information needed by the logic to build the blocks is available yet, so the added code would have to duplicate some of the work already being done.

The drawback of the second option is that it leaves us with another filter to manage and invoke.

So after some discussion Volker and I decided that the third option would be preferable to the other two.

The brief for this ticket is to duplicate the logic implemented by the existing JavaScript code (except for the bug in that code which mangles the attributes of the nav element it creates) when the JSON is being assembled by cdrpub.py for the CMS, and deploy the modified code once the comparable JavaScript code has been removed from Drupal.

Comment entered 2021-12-20 11:46:17 by Kline, Bob (NIH/NCI) [C]

This has been implemented, but the new code cannot be enabled until https://github.com/NCIOCPL/cgov-digital-platform/issues/3260 is ready (otherwise we'd have duplicate "In This Section" blocks).

Comment entered 2022-01-20 13:46:51 by Kline, Bob (NIH/NCI) [C]

This is in place on CDR DEV.

Comment entered 2022-02-23 09:18:47 by Osei-Poku, William (NIH/NCI) [C]

Verified on DEV. Thanks!

Comment entered 2022-06-17 11:54:22 by Englisch, Volker (NIH/NCI) [C]

The software changes have been moved to production.  

Closing ticket.

Elapsed: 0:00:00.001331