openownership / openownership.org-wagtail

Open Ownership Wagtail site.
Other
1 stars 1 forks source link

Look into tag linkage on section tags #234

Open drcongo opened 2 years ago

drcongo commented 2 years ago

@drcongo Have just been checking/testing this. OO Principles links look to be working great but section tags not linking up properly for me on staging and are just linking to the same content page:

https://openownership.hactar.work/en/blog/beneficial-ownership-data-standard-approved-by-uk-government/ https://openownership.hactar.work/en/news/welcome-to-the-new-open-ownership-website/

Originally posted by @StephenAbbott in https://github.com/hactar-is/openownership.org/issues/161#issuecomment-1170508895

drcongo commented 2 years ago

This turned out to be just that those tags don't have associated TagPages, however, it's still a bug that it was showing them as links when there's nothing to link to. So, I've pushed an update that doesn't link the text if there's no TagPage.

StephenAbbott commented 2 years ago

How do I associate a TagPage with these section tags to make them link back to the section front then?

Can see the change on staging - e.g. https://openownership.hactar.work/en/publications/early-impacts-of-public-beneficial-ownership-registers-ukraine/ - but currently none of the section tags (Research, Implement, Technology, Impact, About) are showing as links

drcongo commented 2 years ago
Screen Shot 2022-08-11 03 37 48 PM

If you create a TagPage anywhere in the system, and point it at one of those section tags here, they will link to that page (maybe with a small delay because caching). However, when you say "link back to the section front", are you not expecting them to go to a tag page?

StephenAbbott commented 2 years ago

So these tags are section tags as created in the Sections taxonomy rather than TagPages. Is there a way to map them so that they link to the Section front?

drcongo commented 2 years ago

No, the expected behaviour was always that tags would link to a tag page, but I can possibly make that happen. I'll have a look now, if the quick and dirty method works then it's a 10 minute job, but if not I think a couple of hours.

drcongo commented 2 years ago

Quick and dirty method looks good. On its way through CI now.

StephenAbbott commented 2 years ago

Thanks @drcongo. Now that this issue is closed, how do I do the quick and dirty method on the production site to map the section tags to the section fronts so that the Sections tag names in the tag list on content links to those section fronts.

See this news article for an example where the 'Implement' section link now appears as plain text instead of a link: https://www.openownership.org/en/news/free-workshops-using-beneficial-ownership-data/

drcongo commented 2 years ago

hey @StephenAbbott it's 99% automatic, looking at the code, all you need is a section page with the same name as a section tag.

StephenAbbott commented 2 years ago

Curious @drcongo. Doesn't seem to be working yet for Technology or Research (need to rename the Implement section tag to Implementation). Should I just be more patient? https://www.openownership.org/en/publications/structured-and-interoperable-beneficial-ownership-data/

drcongo commented 2 years ago

Actually, it looks like I've accidentally closed the wrong issue by referencing it in a different commit. I'll reopen until this change is on production.