task/tup-555 order news article categories#776
Conversation
wesleyboar
left a comment
There was a problem hiding this comment.
Good! This is an excellent base upon which to refine this feature.
-
Move this new logic to its own template, then include that template.
This will isolate complex logic specific to one small aspect of the template.
Examples: I did this with
includes/blog_cats.html(included bybase.html). (I should do this to dates.) -
Suggestion: Move this logic into Python (so it easier to grok and improve).
You can move logic to Python via a template tag or filter (Django docs).
Example: An existing template tag
blog_post_use_custom_media.pythat works with News categories. -
Consider how to reduce duplicate logic. (Probably easier w/ Python code.)
I see 3 for loops, and 3
<li>'s. Hopefully, this can be done with less of each. -
Bonus: Consider whether and how to integrate with Core-CMS
settings.Other CMS's would have different categories, and maybe a different order.
Example: Setting
TACC_SOCIAL_SHARE_PLATFORMSis an array used byshare_on_social.html.
|
7c52f1c
|
wesleyboar
left a comment
There was a problem hiding this comment.
Regarding the issue about category numbers not being in order:
- I don't mind. We don't use those class names.1
- I failed to replicate the issue. They are in order for me.
Footnotes
-
Most of the blog/news class names came from a reference template. I might even replace them with TACC class names. ↩
Overview
Orders the news article categories.
Related
https://tacc-main.atlassian.net/browse/TUP-555
Changes
'press-release, feature-story','multimedia, podcast', and'press-release, feature-story, multimedia, podcast'ifstatement checks the slug against the strings in the first two, and checks if it is not in the last-- The logic above will order the lists as such
Testing
UI
Notes
I came away with an issue. @wesleyboar Please let me know if this is an issue or if we can troubleshoot this together.Issue: Although the categories are in the order we'd like them to be, they class numbers are not correlated with their order on the page. Unsure of a solution at the moment. But working to fix.
Edit: This is no longer issue as of 05d4e7f
