Skip to content

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

Merged
wesleyboar merged 3 commits intomainfrom
feat/TUP-707-do-not-show-TAG-in-tag-filtered-news
Feb 29, 2024
Merged

feat: TUP-707 do not show "TAG - " in news filter#804
wesleyboar merged 3 commits intomainfrom
feat/TUP-707-do-not-show-TAG-in-tag-filtered-news

Conversation

@wesleyboar
Copy link
Copy Markdown
Member

@wesleyboar wesleyboar commented Feb 28, 2024

Overview

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

Related

Changes

  • changed whitespace in template
  • added markup to wrap text to hide
  • added css to hide text

Testing

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

    BLOG_… settings
    ########################
    # 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
    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

@wesleyboar wesleyboar marked this pull request as ready for review February 29, 2024 20:47
@wesleyboar wesleyboar merged commit 542ccfa into main Feb 29, 2024
@wesleyboar wesleyboar deleted the feat/TUP-707-do-not-show-TAG-in-tag-filtered-news branch February 29, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant