Can I create a menu with sub-menus in Agile Toolkit? - php

The menu class documentation - and the provided example - do not seem to show any way for me to build a navigation menu with more than 1 level of navigation.
What do I do if I want to build an 'app-style' menu - like 'File' or 'Edit' - which will include sub-menus? Is there a way to create this automagically with Agile Toolkit, or is this something that would have to be coded by hand with html templates, css files, etc.?

there is no such component by default - however, View "plug'n'play" also works for Menu's
here is one example of real life 2-level submenu:
http://www.gradpool.ie/gradmatcher/graduate/company.html?id=38
idea there is that menu is constructed, and drop downs which fall out are yet another menu objects inserted into menu items.
add-on for this purpose has been created, read here:
http://www.ambienttech.lv/blog/2012-07-06/tree_view_in_agile_toolkit.html

I would suggest to use your own CSS along with Menu_Light, which is designed to get out of your way as much as possible.
https://github.com/romaninsh/atk4-sitesample/blob/day1/templates/Symisun_01/shared.html
https://github.com/romaninsh/atk4-sitesample/blob/day1/lib/Application.php
The only thing it does is adding a class to your menu template, the rest you control over the HTML.
As a result you'll get something like this: http://example.agiletoolkit.org/examples/website/index.symisun
Be sure to use page tag around page names account/register.

Related

more than one text separator style per template in joomla 3.0

Let me first explain what I am trying to do.
In joomla 3.0 I have created a Menu_Item_Text_Separator override for my template http://docs.joomla.org/Help30:Menus_Menu_Item_Text_Separator. It seems as though joomla will only recognize one default Text separator per template which is ok if you just want the one. but I ideally would like to have the choice of selecting the custom one in my template folder as well as the default one that joomla recognizes. To inform you this is what I have done to make it happen.
in my template I have a folder named html which had a folder called mod_menu inside it.
In the mod_menu folder I have the .php files called:
default_separator.php
custom_separator.php
I then go into menu manager and edit the menu item for which I want to display a text separator for.
I then go to 'template style' http://docs.joomla.org/Help30:Menus_Menu_Item_Text_Separator and look for my custom style. but I only can choose the default one.
So i wonder if this is way that joomla works that you can only have one default per template. but is it possible to have more than one?
any advice most welcome.
regards
w9914420
Sorry this got too long for a comment.
Okay let's start from the beginning. Templates have a set of parameters defined in the templateDetails.xml file. A template style is simple a record containing the information about a template and the array of parameter options you have selected. You can make as many template styles as you want for a given template Each one has its own name. In the menu you can select any of the styles and assign it to a menu item. ....
What you are talking about has nothing to do with template styles. You are talking about using a layout override for mod_menu. Because you are using a file with the same name as a core layout file you should get a 1:1 replacement.
From what I understand of what you want to do, you should instead make a new named replacemen both for default_separator and for default.php. THat's because the alternative layout field is going to look for a replacement for default.php say yourname.php and then in that replacement when you load a template called separator it is automatically going to look for yourname_separator rather than default_separator because it assumes you are appending the _separator to the base name. If you do this it has some advantages such as you will be able to make a more complex layout and it will allow you to load different sub layouts conditionally for example.
I think your are confusing template styles with the style for menu module. Unless you have a parameter in your template that specifies the choice of a mod_menu layout a template style is not going to help you.Go to he module manager and pick the module you want to apply the style to. Use the field to select the layout you want. Or if it is a css style use the style option. It could also be that what you really want is to apply module chrome. THat do can be done by editing the module. If you want to have the same menu with different layouts or styles you'll probably want to make additional modules for that menu.
I had a rethink of what i was trying to do. What I was trying todo could not be achieved through the method I hoped - creating a template for that one text separator would not be practical although I have now discovered how to feed template parameter values into layout overrides.
Thank you Elin for your time
regards w9914420

Joomla - configuring basic parameteres for my component in menu manager

Im still relatively new to Joomla component development.
I have a component that manages rsvps to events.
In the administration side you create various events and specify the details of when where and what time the event starts etc. Each event has an eventid.
In the frontend I want to be able to show a specific events details when a menuitem is clicked.
In Joomla administration, my thinking is as follows:
1) Go to Menus->Top Menu
2) Click on [New] to create a new Top Menu Item
3) My component is listed there as MyRSVPComponent
But when I click on it, nothing happens??
All the other default components like search have submenus that you can click on that takes you to a Menu Item page and you are able to configure the Basic Parameters on the right hand side.
I want my component to behave like that as well and I want to be able to pick the event from a list that I want displayed for that menu item. How would I go about doing this?
Please do note that I have not followed the Joomla 1.5 MVC structure for my component.
Can I still make this work, or am I forced to create the project with the MVC structure.
I have my reasons for not wanting to go with MVC for this particular project so please do not just suggest that I go MVC unless that is the ONLY way that I going to achieve what I need to do.
The options you see in the menus are controlled directly by the views in your component. You will need a view for each menu item type you would like to have. You don't have to go MVC but it would certainly make life easier.
I just came across this question with the view to integrate a Symfony project into a Joomal component. Naturally I don't want to use the Joomla MVC for this as well.
I have done some debugging on how to create your menu links:
You need to have the link field set for your component, matching your component folder
You need to have the views folder, matching the "option" field value of your component database entry
As soon as you have this, the menu manager is going to show your views as options
To have specific view sub options, you need to create /com_yourcomponent/views/yourview/layout.xml, copy these from com_content. In there you can also define your menu options.

is there a way to use a view as a menu in drupal?

I want to have a view displayed as a menu either in primarylinks or secondarylinks.
I searched and looked up all modules with no luck.
should I build this functionality manually ==> build a module?
thanks in advance
Primary and secondary links (in fact, all menus) are rendered as unordered lists of links using a theme function like theme_links(). You can get pretty close to the same functionality by using the HTML List style within a view.
You can't duplicate it exactly because Drupal's menu system requires static menu items: it doesn't handle wildcards like the results of a query.
That is, Drupal's menu system is cached, and is only rebuilt upon request (e.g. by adding a menu item manually, clearing the cache, etc.) A view, on the other hand, is a wrapper to a query: every time you access the view, unless it too is cached, it runs a query to get the latest results.
So, if you were to inject a view into a menu, it'd only be the results at the time of first request, and any subsequent changes would require rebuilding the menu.
The solution I suggested will let you keep the functionality of the view, theme it to look like a menu, and avoid the caveats of the menu system.

How to make menu navigation structures with Kohana?

I had created my own little lightweight framework for small projects, and now switched to Kohana.
But I wonder what's the way to go to achieve navigation hierarchies.
Example: I have a menu like this:
Home | Products | Support | Contact
In my old framework, when the user clicked on "Products", my framework knew which navigation layer this is and then my view attached an "_active" suffix to the css class of that menu item, so it's highlighted. The same for all parent navigation elements.
How are you setting up your site in Kohana to achieve something like this?
I thought about making one big layout view that contains the menu bar. There, I would have to implement all the logic to figure out which menu item has to be highlighted as active. Is there any clever mechanism for this, or would I just have to figure out from the current url somehow in a bunch of if-statements, if an url segment matches the menu item?
You can use the uri::segment() method to get the current page, and then determine what your suffix should be based on that.
Example:
# Example Url: http://www.example.com/index.php/article/paris/hilton/
echo $this->uri->segment(3); // Returns 'hilton'
From there it's just a matter of checking the returned value against each one of your navigation links - when it maches, add your suffix.

Building a menu the MVC way in PHP

Hello I'm building my own PHP MVC framework. Not with the intention of using it. But I'm trying to learn PHP5 OO and the MVC design pattern.
I've read a lot of tutorials and got the basics working but now I'm stuck since things are getting more complicated.
My framework uses the following URL structure: /controller/action. Optionally followed by an inifinite number of variables, e.g. /product/view/1.
So far I got two separate controllers: page and product. I wan't to include them both in a single menu. I'm trying to establish the following menu structure. The corrosponding URL is between brackets.
Our company (/page/view/2)
Werkwijze (/page/view/3)
Staff (/page/view/4)
Our products (/product/index)
Bread (/product/category/1)
Banket (/product/category/2)
Cake (/product/category/3)
Contact (/page/view/5)
So basically I got a main menu and a sub menu. There are a few requirements I defined for the menu class:
The current item should have a different CSS class in the menu.
If the current item has a parent than that should have a different CSS class as well.
The menu should be expandable using all kinds of content a URL's.
And for bonus points: when I select a product from the Bread category. Let's say /product/view/1; then I'd like the 'Our products' and 'Bread' menu items to be highlighted as well.
I've got a copy of my 'framework' running here: http://www.eriknijland.nl/stackoverflow/. The content is in Dutch though and the menu is just static HTML.
The source code is available for download as well in the folder:
/stackoverflow/source/framework.zip
/stackoverflow/source/framework.sql
Any other comments on my code are welcome as well :P.
All the code to build that should be in the view layer of the application. Of course, the framework should provide methods to know wich module and action are active, but the behavior of the menu should be implemented in the application and not in the framework.
Another option would be to design the framework so that it provides some helpers to build menus automatically. In this case, everything should be implemented within the view layer of the framework.

Categories