TACC / Core-CMS

The Core CMS codebase used by TACC Portals.
https://cep.tacc.utexas.edu
2 stars 1 forks source link

feat: TUP-707 do not show "TAG - " in news filter #804

Closed wesleyboar closed 4 months ago

wesleyboar commented 4 months ago

Overview

Do not show "TAG - " or "ARCHIVE - " et cetera in filtered News.

Related

Changes

Testing

  1. Add/Edit taccsite_cms/settings.local.py to have BLOG_… settings.

    BLOG_… settings ```py ######################## # DJANGOCMS_BLOG ######################## from taccsite_cms.settings import INSTALLED_APPS tacc_app_index = INSTALLED_APPS.index('taccsite_cms') INSTALLED_APPS[tacc_app_index:tacc_app_index] = [ # 'filer', # already in Core # 'easy_thumbnails', # already in Core 'parler', 'taggit', 'taggit_autosuggest', # 'meta', # already in Core 'sortedm2m', 'djangocms_blog', ] # REQ: 'taggit_autosuggest' requires the following is added to `urls.py` """ urlpatterns += [ # Support `taggit_autosuggest` (from `djangocms-blog`) url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')), ] """ # Paths for alternate templates that user can choose for blog-specific plugin # - Devs can customize core templates at `templates/djangocms_blog/`. # - Users can choose alt. templates from `templates/djangocms_blog/plugins/*`. # - Devs can customize alt. templates at `templates/djangocms_blog/plugins/*`. BLOG_PLUGIN_TEMPLATE_FOLDERS = ( ('plugins', 'Default'), # ('plugins/alternate', 'Alternate'), ) # Change default values for the auto-setup of one `BlogConfig` # SEE: https://github.com/nephila/djangocms-blog/issues/629 BLOG_AUTO_SETUP = True BLOG_AUTO_HOME_TITLE ='Home' BLOG_AUTO_BLOG_TITLE = 'News' BLOG_AUTO_APP_TITLE = 'News' BLOG_AUTO_NAMESPACE = 'News' # Miscellaneous settings BLOG_ENABLE_COMMENTS = False ```
  2. Verify in your settings that BLOG_AUTO_SETUP = True.

  3. Add/Edit urls_custom.py to have custom url path('taggit_autosuggest/', include('taggit_autosuggest.urls')).

    sample file content ```py from django.urls import path, include custom_urls = [ path('custom_test/', include('apps.custom_example.urls', namespace='custom_test')), # To support `taggit_autosuggest` (from `djangocms-blog`) path('taggit_autosuggest/', include('taggit_autosuggest.urls')), ] ```
  4. (Re-)Start Core-CMS instance.

  5. (If using pre-existing Core-CMS instance) Run build and collect assets:

    • npm run build:css
    • docker exec -it core_cms sh -c "python manage.py collectstatic --no-input"
  6. Open https://localhost:8000/.

  7. In CMS main nav, click homepage, then "News". If News is unavailable, debug News/Blog installation (internal document).

  8. At http://localhost:8000/admin/djangocms_blog/blogcategory/, "Add blog category" with the Name "Test".

  9. Edit root user via CMS Admin. Set First name to "Root".

  10. Verify heading on these pages is exactly as expected:

    Page Heading
    http://localhost:8000/news/2024/ NEWS — 2024
    http://localhost:8000/news/tag/test/ NEWS — Test
    http://localhost:8000/news/category/test/ NEWS — Test
    http://localhost:8000/news/author/root/ NEWS — Articles by Root

UI

Archive Tag
archive tag
Category Author
category author