I need to change the menu list (when clicking the gravatar) when login into the Website according to the Roles of the user.
The menu list I mean,
MY Account
Logout
When I examined, I came to know that the menu comes from the navbar_login.html file
But it shows
<ul class="dropdown-menu" role="menu">
{%- for child in post_login -%}
<li {% if child.label %}data-label="{{ child.label }}" {% endif %}
{% if child.class %} class="{{ child.class }}" {% endif %}>
{%- if child.url -%}
<a href="{{ child.url | abs_url }}" {{ child.target or '' }}
rel="nofollow">
{{ child.label }} <!-- My account, Logout -->
</a>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
I am bit unaware of this. that is getting data inside HTML.
Many HTML file includes data from py file.
Can anybody make me know from where this ‘post_login’ data in the for loop comes? What is the corresponding .py file for this .html file?
So when we create a custom HTML file and want to get some data from database what can i do?
Is it enough that I should create a py file with the same name? Then I get the values of the variable in py to HTML file?
I have not created any DocType… I am talking about a simple HTML file creation and showing data there. So my doubt is to from where we get data.? No .json file.
@royprotim Gotcha. I’m also working on this bit now with the help of the MN Technique team. I can get you as far as the collecting the client side form JS variables, but I haven’t gotten farther than that.
@revant_one@gvrvnk I meant to bring this up on our most recent call and it totally escaped me. I assume it’s some sort of callback?
It is recommended to use Custom Dialog to get inputs as it has docfields. Refer example. It has button for “Log Visit” which adds new_doc with quick entry or custom dialog.
Note: in the above example call_allocations_html template renders only latest five and adds a view all button which set_route to normal Frappe list view.