Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Wagtail CRX (CodeRed) Settings Override

Overrides of default Wagtail CRX settings, eg. navbars, footers, etc.

Quick start

  1. Install the package from PyPi:

    pip install crx-settings-override
    
  2. Add "crx_settings_override" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
       ...,
       "crx_settings_override",
    ]
    
  3. Add "crx_settings_override.context_processors.navbars" and "crx_settings_override.context_processors.footers" to your TEMPLATES settings like this::

    TEMPLATES = [
       {
          ...,
          "OPTIONS": {
                "context_processors": [
                   ...,
                   "crx_settings_override.context_processors.navbars",
                   "crx_settings_override.context_processors.footers"
                ],
                "loaders": [...]
          },
       },
    ]
    
  4. To make translations work for navbars, override navbar template of CodeRed by creating /templates/coderedcms/snippets/navbar.html and change

    {% if settings.coderedcms.LayoutSettings.site_navbar %}
       {% get_navbars as navbars %}
          {% for navbar in navbars %}
          <ul class="navbar-nav {{navbar.custom_css_class}}" {% if navbar.custom_id %}id="{{navbar.custom_id}}" {% endif %}>
             {% for item in navbar.menu_items %}
                {% include_block item with liclass="nav-item" aclass="nav-link" ga_event_category="Navbar" %}
             {% endfor %}
          </ul>
       {% endfor %}
    {% endif %}
    

    so it doesn't use site_navbar and get_navbars method (this is overriden by the context_processor), eg. simply erase those lines like this

    {% for navbar in navbars %}
       <div>
          <ul class="navbar-nav flex-wrap justify-content-around">
             {% for item in navbar.menu_items %}
               {% include_block item with liclass="nav-item fs-5" aclass="nav-link" ga_event_category="Navbar" %}
             {% endfor %}
          </ul>
       </div>
    {% endfor %}
    
  5. Run python manage.py migrate to create the models.

  6. Start the development server and visit the admin to:

    • create localized navbars under Snippets > Translatable Navigation Bars
    • set one of the localized navbar as a site navigation in CRX Settings Overrides.
  7. Navigation switches automatically based on current site localization.

Development

Update semantic version of the package

Run test update without commiting

$ bumpver update --patch(--minor|--major) --dry

Run update and commit the changes to the repo

$ bumpver update --patch(--minor|--major)

Metadata

Release files for crx-settings-override 1.0.0b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crx-settings-override 1.0.0b0
File Size Uploaded
crx-settings-override-1.0.0b0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crx-settings-override 1.0.0b0
File Interpreter ABI Platform
crx_settings_override-1.0.0b0-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / crx-settings-override-1.0.0b0.tar.gz

Download URL crx-settings-override-1.0.0b0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
de4b091d43eb17db395ceabb5b56bf3a4bafcc33397b9a83498aaa3de3c2305a
BLAKE2b-256 checksum
How to use checksums
636bea1a78a2ac84abfdae79bea9e1625ef6472a286b8e501b2069e7bb10ae8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release files / crx_settings_override-1.0.0b0-py3-none-any.whl

Download URL crx_settings_override-1.0.0b0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53593e3859a351958704ceb535a73911dd6d3ddc0ace11c761fd704ff350c3c1
BLAKE2b-256 checksum
How to use checksums
cb8ba503f0bd0c8e1a77b3ffd4b0f04bbd97cb7f574b9dd56331b032a44a9aa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release history Release notifications | RSS feed

This release

1.0.0b0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page