views:

260

answers:

3

hi,

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!

A: 

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

Martin
yes, i did it in the MVC fashion, the problem is that I didn't use the jview, I did a mvc approach from scratch, and I have a folder with all the views I need. Is there any workaround that let me use this approach in the menu types?
dmb
Martin
dmb
A: 

You may need a metadata.xml file for each of your views. See http://docs.joomla.org/Adding_view_layout_configuration_parameters for more details

Don Cranford
I try that, but the problem is I have my own view classes. I don't use joomla view classes. I have also a slightly different way of organizing the component folders. Maybe I have also to include something inside the classes.
dmb
A: 

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
Hone Watson