Skip to content

Multisite navs#408

Merged
vsalvino merged 55 commits into
devfrom
multisite-navs
Jun 9, 2022
Merged

Multisite navs#408
vsalvino merged 55 commits into
devfrom
multisite-navs

Conversation

@rcoldiron
Copy link
Copy Markdown
Contributor

@rcoldiron rcoldiron commented Mar 1, 2021

Description of change

  • I updated the LayoutSettings model to include a navbar chooser and footer chooser
  • I updated the get_footer and get_navbar functions to pull in the choice from settings
  • I updated the templates to pull in the choices and also what to do if no choice is made
  • Related to Navbar and Footer snippets to not support multisite #202
  • Multiple sites can use the same navbar/footer if chosen in the Layout Settings for each site
  • Simple implementation for select site navbar and footer

Documentation

Updated docs with the change.

Tests

Manual testing after migrating: Create a navbar and footer snippet and select them in the settings chooser. Make several to switch between snippets and also see what happens when no snippet is chosen. Add an additional site to Sites and select a navbar and footer for that site.

Roxanna Coldiron added 2 commits February 25, 2021 17:29
…bar and get_footer functions, fixed templates to render the choices, also setting for what to do if no site navbar or footer is chosen
@rcoldiron rcoldiron requested a review from vsalvino March 1, 2021 18:29
Comment thread coderedcms/models/wagtailsettings_models.py Outdated
Roxanna Coldiron added 8 commits March 1, 2021 13:53
… the best and looks the best in Settings but still not able to actually grab and loop through the navbars in the template. Tutorial I used: https://learnwagtail.com/tutorials/how-use-orderables-wagtail-cms/ Also, Page is a ClusterableModel and that's why I made LayoutSettings a ClusterableModel so that the Orderable connection would work.
…ooter instance within the orderable, adjusted template for footer to loop through footers, new single migration
@rcoldiron
Copy link
Copy Markdown
Contributor Author

@vsalvino Ready for another full review. Then show me how to write a manual migration please.

Comment thread coderedcms/migrations/0020_footerorderable_navbarorderable.py Outdated
Roxanna Coldiron added 6 commits March 16, 2021 12:07
…ngs. Need to pull in instances - but want to only pull in current navbars/footers, not all future navs/footers that may be added to snippets if this migration ends up being run again or if we have manually separated the navs in a template for a specific site - so how to loop through only current instances once and add them to layout? will this migration be run each time you migrate - because it will produce duplicates if so - so how to specify only run it this one time?
…s and not to run if new site, fixed template tags for getting navbars and footers and rendering the correct sort order
@rcoldiron
Copy link
Copy Markdown
Contributor Author

NOTES TO SELF: Next steps are to add unit tests and documentation.

@vsalvino vsalvino modified the milestones: 0.21.0, 0.22.0 Aug 2, 2021
@vsalvino vsalvino modified the milestones: 0.22.0, 0.23.0 Sep 9, 2021
@vsalvino vsalvino added the PR: Awaiting Review Awaiting review and approval label Jan 28, 2022
@vsalvino vsalvino merged commit 0be59a7 into dev Jun 9, 2022
@vsalvino vsalvino deleted the multisite-navs branch June 9, 2022 21:32
@vsalvino vsalvino removed the PR: Awaiting Review Awaiting review and approval label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navbar and Footer snippets to not support multisite

2 participants