-
Notifications
You must be signed in to change notification settings - Fork 174
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
How to add buttons (links) to Geonode Menu bar using geonode-project 4.1.x? #394
Comments
Welcome to the community @eruiz67 You do not need to fiddle with the code but could use the already implemented configurable additional menu bar. |
Thank you so much for your help, but, Is it possible to create a menu and
menu items with code?, I want to create a new django app for geonode, with
some views and I want to create Menus and menu items for that app. So, when
i install that new app, all menus and menu items will be installed,
El mar, 3 ene 2023 a las 4:15, Florian Hoedt ***@***.***>)
escribió:
… Welcome to the community @eruiz67 <https://github.com/eruiz67>
Will this functionality solve your issue:
https://docs.geonode.org/en/master/admin/admin_panel/index.html#menus-items-and-placeholders
You do not need to fiddle with the code but could use the already
implemented configurable additional menu bar.
—
Reply to this email directly, view it on GitHub
<#394 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APEMEBAATOBW2EVQPPGPOTTWQPU3ZANCNFSM6AAAAAATO2YRFY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @eruiz67 def run_setup_hooks(*args, **kwargs):
from django.conf import settings
from geonode.urls import urlpatterns
from geonode.base.models import Menu, MenuItem, MenuPlaceholder
LOCAL_ROOT = os.path.abspath(os.path.dirname(__file__))
settings.MAPSTORE_TRANSLATIONS_PATH += ("/static/mapstore/ea-translations",)
settings.TEMPLATES[0]["DIRS"].insert(0, os.path.join(LOCAL_ROOT, "templates"))
# THIS IS THE IMPORTANT PART:
if not Menu.objects.filter(title="External Applications").exists():
ph = MenuPlaceholder.objects.filter(name="TOPBAR_MENU_LEFT").first()
menu = Menu.objects.create(title="External Applications", placeholder=ph, order=1)
MenuItem.objects.create(title="External Applications", menu=menu, order=1, blank_target=False,
url="/catalogue/#/search/?f=externalapplication")
urlpatterns += [url(r'^external-applications/', include('externalapplications.urls'))] |
Hello, I just posted an issue on github
Could you help me
In geonode when an user logs in, it is automatically redirected to the
Profile page. I am trying to change that and redirect to the Home (index
page). In order to to that I added the following line to the settings.py"
in my geonode-project folder. But the user is still redirected to the
Profile page when he/she performs the authentication
ACCOUNT_LOGIN_REDIRECT_URL = "/"
I also tried with the following line:
LOGIN_REDIRECT_URL = "/"
Am I doing something wrong?
According to the geonode documentation (
https://docs.geonode.org/en/master/basic/settings/index.html) the
ACCOUNT_LOGIN_REDIRECT_URL "allows specifying the default redirect URL
after a successful login.", so why is not working
El mié, 4 ene 2023 a las 3:47, Florian Hoedt ***@***.***>)
escribió:
… Hi @eruiz67 <https://github.com/eruiz67>
You could use your externalapplications/__init__.py and run_setup_hooks()
to auto-create these entries if they are not present. Here is a (not fully
working) example which should give you a good enough insight:
def run_setup_hooks(*args, **kwargs):
from django.conf import settings
from geonode.urls import urlpatterns
from geonode.base.models import Menu, MenuItem, MenuPlaceholder
LOCAL_ROOT = os.path.abspath(os.path.dirname(__file__))
settings.MAPSTORE_TRANSLATIONS_PATH += ("/static/mapstore/ea-translations",)
settings.TEMPLATES[0]["DIRS"].insert(0, os.path.join(LOCAL_ROOT, "templates"))
# THIS IS THE IMPORTANT PART:
if not Menu.objects.filter(title="External Applications").exists():
ph = MenuPlaceholder.objects.filter(name="TOPBAR_MENU_LEFT").first()
menu = Menu.objects.create(title="External Applications", placeholder=ph, order=1)
MenuItem.objects.create(title="External Applications", menu=menu, order=1, blank_target=False,
url="/catalogue/#/search/?f=externalapplication")
urlpatterns += [url(r'^external-applications/', include('externalapplications.urls'))]
—
Reply to this email directly, view it on GitHub
<#394 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APEMEBAQO22C5S6F2VMYAKTWQU2JNANCNFSM6AAAAAATO2YRFY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I just install Geonode-project 4.1.x and try to follow the official documentation (https://docs.geonode.org/en/4.x/devel/workshops/index.html#customize-the-look-and-feel) to customize the look and add some Links (buttons) to the navigarion bar.
So far I have created the templatetags folder and create the "get_menu_json.py" file with the following content
But this is not working. Geonode is still showing the same buttons (Dataset, Maps, etc). My intention is to add (I am saying add, not override) buttons to the Navigation Bar, so i can access the new views I have created for geonode project. I am using geonode-project 4.1.x. Documentations appears to be outdated.
I posted this question with pictures
[https://stackoverflow.com/questions/74941783/how-to-add-buttons-links-to-geonode-menu-bar-using-geonode-project-4-1-x]
The text was updated successfully, but these errors were encountered: