Patch #21587
closed
Additional view hook for body_top
Added by Tobias Fischer almost 9 years ago.
Updated almost 9 years ago.
Description
Any chance to add the following one-liner to add another hook at the beginning of the body element like we have it at the bottom?
Let's call it view_layouts_base_body_top
(analogous to view_layouts_base_body_bottom
).
</head>
<body class="<%=h body_css_classes %>">
<%= call_hook :view_layouts_base_body_top %>
<div id="wrapper">
It's a one-liner, it doesn't need tests, it doesn't break anything – please merge this in the next minor release.
This could be used by plugin authors like me to display additional information at the top of the page...
This is a duplicate of #17454 which doesn't seem to draw attention to the developers as it's just another Feature Request among 20.000 others and can't be changed to the tracker "Patch" to appear in the patch queue...
If someone of the Redmine team ever reads this, please considder changing permissions for ticket authors to allow them to switch the Tracker for their tickets...
Files
+1 for this suggestion. Updated the patch for 3.2.0.devel.15067.
There are following 3 hooks in app/views/layouts/base.html.erb. I think we would be better to add :view_layouts_base_body_head, corresponding with :view_layouts_base_body_bottom.
- :view_layouts_base_html_head
- :view_layouts_base_content
- :view_layouts_base_body_bottom
Thanks for review and assigning to 3.3 !
Regarding the naming:
I personally would stick to my suggestion
:view_layouts_base_body_top
and not use
:view_layouts_base_body_head
as it might be confusing whether it applies to the
<head>
or the
<body>
element.
Also, other view hooks which insert things at the start are named
_top
:
:view_issues_new_top
:view_account_login_top
(and correspondant :view_account_login_bottom
)
Tobias Fischer wrote:
I personally would stick to my suggestion :view_layouts_base_body_top
and not use :view_layouts_base_body_head
as it might be confusing whether it applies to the <head>
or the <body>
element.
Sorry, my comment on #21587#note-2 has an error. Please interpret :view_layouts_base_body_head as :view_layouts_base_body_top.
No problem in the patch Additional-view-hook-body_top_v2.patch.
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
Also available in: Atom
PDF