Hi,
I have several views which are similar, so I am using common view file using "response.view =common_view.html" rather than separate one per controller.
Out of these - 2 or 3 views are slightly different where certain parts of the page (layout.html) need to be hidden.
I tried :
return dict(msg=msg, grid=grid, hide_my_div=True)
in the view template I have :
{{if hide_my_div:}}
<script>
$(document).ready(function(){
$("#my_div").hide();
});
<script>
{{pass}}
This works for the small number of views where I want to hide "my_div"
Unfortunately - this also means I need to pass "hide_my_div=False" from large number of controllers.
Is there a way to have hide_my_div=False as a default - so that I do not need to return it explicitly - and I can override only when needed (2-3 controllers)
Something like optional params with default values ?
May be the way I am handling this is wrong. Is there a better way ?
(I know that I can create separate view files for these "odd ones", but I prefer not to, since these are going to be 90% similar to common_view.html anyway)
Thanks,
-Mandar