surej ns wrote:
> hi All
>
> The redirect works well .thanks all now i have made another customized
> menu page after login .i wanted to load that menu after login.how can
> i do that. what all i should do to make it
>
> regards
>
> surej
Hi!
I'm not entirely sure I understand, but I'm assuming you mean that you
have made an action that displays a menu.
Ok, first off, you need to add a new "layer". Open up output_types.xml,
and locate the line saying something
along the lines of <layer name="content" class="AgaviFileTemplateLayer" />
This defines a "layer" that your layouts use (more on this in the manual
once it's written).
Let's add another layer for the templates to use, and call this "decorator":
<layer name="decorator" class="AgaviFileTemplateLayer">
<parameter name="template">MainTemplate</parameter>
</layer>
This layer defines the "decorator"-layer into which you can plug other
"actions" as "slots". The parameter-section says
the template for the decorator is called "MainTemplate". You might want
to put this template into your main templates
-directory by setting <parameter
name="directory">%core.template_dir%</parameter>
This template would only have the HTML header stuff and the
"skeleton",so to speak, of the page and simply echo out
$slots['content']; to print out what the "calling" action has output.
For example:
<html>
<head>
<title>Agavi rocks!</title>
</head>
<body>
<div class="header">header stuff here</div>
<div class="left-hand-menu-bar-thingie">menu comes here</div>
<div class="content"><?php echo $slots['content']; ?></div>
</body>
</html>
(Of course, you would make yours with the proper doctype tags and so on
and so forth, this is just a crude example.)
Now, to add a slot we must do a couple of things:
First off, we must add the slot to the main layer. This is done
(surprisingly enough) with <slot>
Simply add <slot name="menu" module="YourModule"
action="YourActionThatCreatesTheMenu" /> to the layer.
Secondly, we must define a new layout for the slot. Otherwise the slot
would load the main layout which would load the
slot which would load the main layout which would load the slot ad
infinitum.
To add a new layout, you simply add a new layout -section to
output_types.xml:
<layout name="menu">
<layer name="content" type="AgaviFileTemplateLayer" />
</layout>
Thirdly, you must tell your slot which layout to load in the view. This
is simply a matter of using $this->loadLayout('menu');
or if you use the setupHtml() that the agavi scripts generate, you'd use
$this->setupHtml('menu');
Now, to actually *display* your new menu, you need to edit your
decorator template:
<div class="left-hand-menu-bar-thingie"><?php echo $slots['menu']; ?></div>
Reload, et voilá! You have a menu!
(David, Veikko: if I have blatant disinformation here, please hit me
over the head)
Hope this helps at least to get started,
Markus
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users