feat(nav): set a CMS menu link to open in new tab - via setting#1150
Draft
wesleyboar wants to merge 1 commit into
Draft
feat(nav): set a CMS menu link to open in new tab - via setting#1150wesleyboar wants to merge 1 commit into
wesleyboar wants to merge 1 commit into
Conversation
Add PORTAL_CMS_MENU_NEW_TAB_PAGE_IDS setting and a NewTabModifier (cms_menus.py) that annotates matching menu nodes via reverse_id. Extend target_blank tag to accept an optional menu node and honor the annotation, keeping template calls clean. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Let us configure specific CMS menu links to open in a new tab.
Usage requires:
Previously, only external links got
target="_blank".Caution
Alternatives exist:
PORTAL_JS_FILENAMESRelated
Changes
NewTabModifierintaccsite_cms/cms_menus.pyPORTAL_CMS_MENU_NEW_TAB_PAGE_IDSnew_tabPORTAL_CMS_MENU_NEW_TAB_PAGE_IDStarget_blankto honorattr['new_tab']cms_menu.htmlsettings_custom.example.pyTesting
PORTAL_CMS_MENU_NEW_TAB_PAGE_IDSinsettings_custom.pyand restart.UI
Warning
Untested.
Made with Cursor. Directed and scrutinized by @wesleyboar.