Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

show joomla component in menu item type

I made a component for Joomla and it's working ok with the direct url: http://www.something.com/index.php?option=com_pbform

The problem is that when I try to add it in the menu. When I change the menu item type, the component is listed, but when I click on it I don't get a view to apply to the menu item.

Do I have to configure anything else in the component?

Thank you!

like image 945
dbeja Avatar asked Jun 22 '10 11:06

dbeja


2 Answers

Add your component to jos_components table:

INSERT INTO jos_components (name, link, admin_menu_link, `option`)
VALUES (
  'Greetings', 'option=com_greetings', 'option=com_greetings', 'com_greetings')

If you have all your views set up correctly you need to add your component into the Joomla database.

Functions and view folders must have no hyphens or underscores.

Good

  • /view/viewone
  • /view/viewtwo
  • /view/viewthree

Bad

  • /view/view_one
  • /view/view_two
  • /view/view_three
like image 57
Hone Watson Avatar answered Sep 28 '22 17:09

Hone Watson


If you setup your component in the MVC fashion then you would have a views/layout folder structure in your component folder. Each different view you have in there will be listed in the menu types under your component name. This is where the views can be chosen.

For e.g. in your component folder structure you have

views/view_a
views/view_b
views/view_c

then in the Joomla menu selector you would have those choices to select as a view.

If you haven't setup your component as MVC then have a look at this tutorial on how to do just that http://www.joomladevuser.com/tutorials/components

I hope that helps! Cheers

like image 39
Martin Avatar answered Sep 28 '22 17:09

Martin