-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidebar bookmarks, closes #1175 #1176
base: main
Are you sure you want to change the base?
Conversation
A new setting HELPDESK_BOOKMARKS is added. Defaults to an empty list. If it is set to to a list of dictionaries each list item is rendered as either external or internal link in a separate section on the bottom of the sidebar menu. Bookmarks are specified as one of - { 'URL': external_url, 'label': label } .. external link - { 'name': internal_name, 'label': label } .. internal name, resolved with reverse() If the 'label' is omitted, the URL or name is used as label.
I personally would prefer to add sections to the django template if needed so that you can simply over-ride and reimport the the template than to have a new setting for this. |
Can you elaborate on this. I'll consider doing the respective changes when I know how to do it. Maybe there is an example you can point me to. |
Yes I think documentation could be better explained on this page, maybe with an example like overriding the sidebar. Following Django documentation, we could add custom blocks in django-helpdesk templates in order to avoid too much copy-pasting when overriding a file. |
To do this you would rename https://github.com/django-helpdesk/django-helpdesk/blob/main/helpdesk/templates/helpdesk/navigation-sidebar.html to navigation-sidebar-base.html you can then add blocks like so
Then you would add a new Then you would create a PR to this repo. After that, you can add a template file to the appropriate directory to override
|
This PR adds a configuration setting:
When set to a list of 'bookmarks', an additional section is shown on the sidebar menu, rendering the bookmarks.
There are two types of bookmarks:
reverse()
method of the URL dispatcherThey are rendered differently so the user can distinguish if she will stay in the Django project or leave to another site.
A bookmark is specified in the following way:
{ 'name':
internal_name, 'label':
label }`{ 'URL':
external_url, 'label':
label }`The
label
is the link text. It is optional, if not given thename
orURL
is used instead.