2

I am busy trying to customize Joomla's Menu Parameters so that in the administrator area when you create a new menu item, You have an additional option of "1 Column" or "2 Column", And this has to be both accessible by the index file of the template and also Joomla! Update Friendly..

And this is basically just to give the user the freedom of selecting the layout style of a particular page.

What Would be the Best way to go about this?

Any Help Greatly Appreciated.

UPDATE

what i am trying to achieve is similar to when you select a category for a menu item in Joomla!, I want to append it to the url exactly like a category, so you select 1 of 2 columns when creating a menu item and then in the url it should say: &col=1 or &col=2.

  • I'm asking to be shure I understand right: You want each menu link to have optional layout of the page it leads to right? – web-tiki Dec 04 '13 at 09:23
  • 100% correct. Is this Difficult? –  Dec 04 '13 at 09:30
  • Yes all you have to do is add an alternate layout wiht that item ... or you could use a form plugin if you really want to add it everywhere which sut seems strange -- what does this everywhere parameter do in a login view or in a view for a third party extension? Selecting a category is something you do in a small percentage of menu types so this is why what you are describing as a universal feature seems puzzling. – Elin Dec 06 '13 at 03:37
  • well it would be limited to menu items, and have a default of 1 or 2 columns. –  Dec 06 '13 at 08:55

2 Answers2

1

Joomla already has a built in parameter for selecting the layout used for a menu item which is the concept of an alternative menu layout. You add the layout to your template html folder with the appropriate xml file. Then that layout will show up in the list of menu options when you select a menu type.

Elin
  • 6,507
  • 3
  • 25
  • 47
1

I have two simple solutions without core haking and that are update friendly.

SOLUTION 1 :

Make 2 different templates with the 2 different layouts call them 1 column and 2 columns. When you make your menu link you can choose between them (Template style dropdown).

SOLUTION 2 : (the one I would recomend)

In your css file make your 2 different layouts based on 2 different css Classes. For example class="1_column" and class="2_columns".

When you make your menu link , under "page display options" you can choose a class for the page it links to. And there you are you can choose between your two layouts.

Hope this helps!

web-tiki
  • 99,765
  • 32
  • 217
  • 249
  • These solutions are good, and i have already thought of them and i would really prefer not making another template nor would i want to edit core joomla. But what i am trying to achieve is similar to when you select a category, i would want to append it to the url like a category, so you select 1 of 2 columns and then in the url it should say: &col=1 or &col=2 as i need to use this in a few places, so getting a parameter from url would be the best possible solution. –  Dec 04 '13 at 09:43
  • Ok, then you will have to create your own menu module. I am not shure appending it to url would be the best solution for SEO reasons. Joomla can handle that in other ways so why not use them? – web-tiki Dec 04 '13 at 09:49
  • well if you turn URL rewriting on it should effect it to much at all. I have created a custom menu module, problem is when creating a new menu item it works with the com_menu and the xml files of each individual component –  Dec 04 '13 at 09:52
  • sorry, ment component – web-tiki Dec 04 '13 at 09:53
  • wouldn't that be a bit heavy? i mean.. com_menu is quiet large and integrated –  Dec 04 '13 at 09:55
  • pretty heavy. The simple way would be to modify the existing one and use an existing field to store your value but it wouldn't be update friendly. – web-tiki Dec 04 '13 at 10:01
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/42480/discussion-between-chadocat-and-dawid-van-der-hoven) – web-tiki Dec 04 '13 at 10:07