Display menus based on the HTML structure of the pages
Project description
# djangocms-local-navigation
This package provides a DjangoCMS plugin that displays a menu based on the
structure of the current page. You can for example create a local menu that is
based on all the h2 elements on your page.
## Installation
`$ pip install djangocms-local-navigation`
Then add it to INSTALLED_APPS:
```python
INSTALLED_APPS = (
# ...
'djangocms_local_navigation',
)
```
Also add the plugin processor, which will add the `id` attributes to your
navigation elements, allowing you to actually linking to them:
```python
CMS_PLUGIN_PROCESSORS = (
# ...
'djangocms_local_navigation.cms_plugin_processors.patch_elements',
)
```
You should now be able to add the plugin "Local menu" to your pages.
## Configuration
### CMS_LOCAL_NAVIGATION_NAV_ELEMENTS
Default: `h2`
Defines which elements are used to create the local menu. This is a CSS
selector so if you want for example only elements with the class
`local-navigation-heading` to be included in the navigation you could use
`h2.local-navigation-heading`.
### CMS_LOCAL_NAVIGATION_XML_PARSER
Default: `None` (means automatic detection)
Defines which XML parser is used to add anchors to the elements and create the
menu. Refer to [the BeautifulSoup documentation](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#specifying-the-parser-to-use)
for more information. Be advised that [lxml has known issues with
mod_python](http://lxml.de/FAQ.html#my-program-crashes-when-run-with-mod-python-pyro-zope-plone)
and can cause your processes to hang.
## Development
To run the tests, use `./setup.py test`.
This package provides a DjangoCMS plugin that displays a menu based on the
structure of the current page. You can for example create a local menu that is
based on all the h2 elements on your page.
## Installation
`$ pip install djangocms-local-navigation`
Then add it to INSTALLED_APPS:
```python
INSTALLED_APPS = (
# ...
'djangocms_local_navigation',
)
```
Also add the plugin processor, which will add the `id` attributes to your
navigation elements, allowing you to actually linking to them:
```python
CMS_PLUGIN_PROCESSORS = (
# ...
'djangocms_local_navigation.cms_plugin_processors.patch_elements',
)
```
You should now be able to add the plugin "Local menu" to your pages.
## Configuration
### CMS_LOCAL_NAVIGATION_NAV_ELEMENTS
Default: `h2`
Defines which elements are used to create the local menu. This is a CSS
selector so if you want for example only elements with the class
`local-navigation-heading` to be included in the navigation you could use
`h2.local-navigation-heading`.
### CMS_LOCAL_NAVIGATION_XML_PARSER
Default: `None` (means automatic detection)
Defines which XML parser is used to add anchors to the elements and create the
menu. Refer to [the BeautifulSoup documentation](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#specifying-the-parser-to-use)
for more information. Be advised that [lxml has known issues with
mod_python](http://lxml.de/FAQ.html#my-program-crashes-when-run-with-mod-python-pyro-zope-plone)
and can cause your processes to hang.
## Development
To run the tests, use `./setup.py test`.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for djangocms-local-navigation-1.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba49b5fb1cfa6c0826fe55d1fe33ac182e9dd096fb0060d953e3ff91c5333297 |
|
MD5 | bb14de79801a28be8373daecac0e9d0a |
|
BLAKE2b-256 | 3d4479c7d6ace796283eb4517dd622591bc99a3c6413ed5460dbe717288dfb1e |
Close
Hashes for djangocms_local_navigation-1.4.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1d1ccc40f44928f2b898c002c25fd167d8aba7960f0c58cc99a59841b0ac3b |
|
MD5 | b452a62eed0144a8950ab0366b2935f1 |
|
BLAKE2b-256 | 2c05cd3ef3e168479ebcc785c1dd20374f8a170df3cfc154e8bdace1a1257590 |