
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Install module
python3 -m pip install djangocms-popup
Add it to your INSTALLED_APPS
"djangocms_popup",
Migrate
python3 manage.py migrate djangocms_popup
Launch your django-cms site, it should be here!
django-cms
: Obviously,django-sekizai
: Only for the template.You can add more choices for the popup using a tuple in your settings, that let you choose which template file to use for each popup.
To do so, just add a var named DJANGOCMS_POPUP_LIST
in your settings, like this:
DJANGOCMS_POPUP_LIST = (
("bottom_right.html", "Bottom right popup"),
("bottom_left.html", "Bottom left popup"),
("top_right.html", "Top right popup"),
("top_left.html", "Top left popup"),
("center.html", "Center popup"),
)
Don't forget to add all the templates in the templates/popup/
folder!
DJANGOCMS_POPUP_LIST
(default: (("bottom_right.html", "Bottom right popup"),)
)
Just a tuple. Let user choose other templates for the popups.
DJANGOCMS_POPUP_TOOLBAR_BUTTON
(boolean, default: True
)
Whether to add a button in the CMS toolbar to list all existing popups
DJANGOCMS_POPUP_TOOLBAR_MENU_IDENTIFIER
(string, default: None
)
The identifier of the menu in which the new button will be added.
If it is None it will be added in the main toolbar.
:warning: Beware that the menu matching the provided menu identifier must exist prior to the creation of the Popup menu: the app defining this menu must appear before djangocms_popup in your INSTALLED_APPS.
DJANGOCMS_POPUP_TOOLBAR_MENU_POSITION
(integer, default: None
)
The position of the button in the toolbar or in the menu defined by DJANGOCMS_POPUP_TOOLBAR_MENU_IDENTIFIER
The template included in this project serves demonstration purpose only, it's up to you to integrate it into your graphic charter by creating a file in templates/popup/popup_plugin.html
.
It's a classic djangocms-plugin, with all the stuff in admin.py
, cms_plugins.py
, cms_toolbars.py
and models.py
.
The "fun" part is in the template.
The child plugins will be rendered inside a div which have a visibility
property (see MDN doc).
Then, a very dumb script (in vanilla javascript) will display the div with a delay using setTimeout
, and will add an event listener on a small button (that will show/hide the popup when clicked).
If the option "Allow the popup to be reopened if it is closed", the small button will still be visible, even if you refresh the page.
The state of the popup is stored inside the localStorage (the id is popup_is_open_{{ instance.id }}
), so a closed popup won't reopen at a page reload.
Warning! The plugin uses the visibility
property! So if any of the plugins you put inside the popup have a visibilit: visible
property it will be shown!
FAQs
DjangoCMS-popup let you create small popups that contains other plugins!
We found that djangocms-popup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.