PASTAplus / DataPortal

EDI Data Portal
3 stars 3 forks source link

add anchor tags to metadata sections for easier linking #71

Closed atn38 closed 2 years ago

atn38 commented 2 years ago

Hello,

It'd be nice if the full metadata display had anchor tags so I can link to one particular section like this: https://portal.edirepository.org/nis/metadataviewer?packageid=knb-lter-ble.13.1#methods.

Motivation: I find myself telling researchers to "go to the landing page, click on View Full Metadata, scroll down and expand the Methods section".

Desired effect: when user clicks on link, they are brought to the section already expanded, i.e. they don't need to toggle the button.

servilla commented 2 years ago

Hi @atn38, this is a great idea! I'll do some experimentation to see how this would best be implemented. I assume you are asking this for all main sections of the metadata page?

atn38 commented 2 years ago

Hi Mark, yes, I suppose it's not too bad to add them all once you get in there. If you can generate anchors for each of the data entities that may be useful as well.

On Thu, Feb 17, 2022, 20:26 Mark Servilla @.***> wrote:

Hi @atn38 https://github.com/atn38, this is a great idea! I'll do some experimentation to see how this would best be implemented. I assume you are asking this for all main sections of the metadata page?

— Reply to this email directly, view it on GitHub https://github.com/PASTAplus/DataPortal/issues/71#issuecomment-1043753721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKAZD5VXAKO6V2FOPKWC3MLU3WU5ZANCNFSM5OV7DNEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

servilla commented 2 years ago

Interestingly, this resolution required javascript on document load to expand all collapsed fields since the page anchors would not automatically go to or expand the collapsed sections. The only drawback to this solution is that all of the collapsed sections are expanded, but only if there is a page anchor in the URL; otherwise, the full metadata page is collapsed by default - business as usual.

Here is an example URL: https://portal-d.edirepository.org/nis/metadataviewer?packageid=knb-lter-ble.17.5#methods

The following id selectors (and their corresponding sections) are now active and can be used as page anchors:

  1. entities (Data Entities)
  2. rights (Data Package Usage Rights)
  3. annotations (External Annotations)
  4. keywords (Keywords)
  5. methods (Methods and Protocols)
  6. people (People and Organizations)
  7. coverage (Temporal, Geographic, and Taxonomic Coverage)
  8. project (Project)
  9. maintenance (Maintenance)
  10. info (Additional Information)
  11. additional (Additional Metadata)
servilla commented 2 years ago

OK, I did figure out how to expand only the section of interest and then scroll the viewport to it.

atn38 commented 2 years ago

This is great, thanks Mark. I'm seeing just the anchored section that's expanded. All others are collapsed as usual. Great solution! I hope this is useful for people.

On Tue, Mar 8, 2022 at 12:12 PM Mark Servilla @.***> wrote:

Interestingly, this resolution required javascript on document load to expand all collapsed fields since the page anchors would not automatically go to or expand the collapsed sections. The only drawback to this solution is that all of the collapsed sections are expanded, but only if there is a page anchor in the URL; otherwise, the full metadata page is collapsed by default - business as usual.

Here is an example URL: https://portal-d.edirepository.org/nis/metadataviewer?packageid=knb-lter-ble.17.5#methods

The following id selectors (and their corresponding sections) are now active and can be used as page anchors:

  1. entities (Data Entities)
  2. rights (Data Package Usage Rights)
  3. annotations (External Annotations)
  4. keywords (Keywords)
  5. methods (Methods and Protocols)
  6. people (People and Organizations)
  7. coverage (Temporal, Geographic, and Taxonomic Coverage)
  8. project (Project)
  9. maintenance (Maintenance)
  10. info (Additional Information)
  11. additional (Additional Metadata)

— Reply to this email directly, view it on GitHub https://github.com/PASTAplus/DataPortal/issues/71#issuecomment-1062064222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKAZD5V6RZTNPSPX56GOKJLU66J7RANCNFSM5OV7DNEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

servilla commented 2 years ago

Hi @atn38 this enhancement is now deployed on all production, staging, and development systems.