URLs for Joomla Component

4.7k Views Asked by At

I have created a simple basic component in joomla named, careerform so I want to know that what will be its url? Will it be :

index.php/?option=com_careerform

or in sef it will be something like: index.php/components/careerform or it will be like this while using .htaccess /careerform

Is it true or what are joomla default URLs with different settings? Please tell what you know.

thanks for your time.

3

There are 3 best solutions below

0
On BEST ANSWER

yes if SEF will be enabled then index.php/component/careerform will be used.

0
On

While what you are asking to do is possible, it would be rather complicated to rename a component. As part of the renaming you would have to update the names of dozens if not hundreds of classes throughout every file of the component. Very likely to run into some bugs because of this.

The far easier prospect is to just avoid these types of urls in your site. Joomla will only fall back to that style of url if a menu item does not exist for the view. Because of that, you can make the url into this:

http://sitename.com/any-component-alias/

To do this, go into the menu manager and create a new menu item. If you don't want this as part of the main menu, you can create a new menu. (I typically have a menu called "Hidden" for menu items that I want aliased but don't actually link to throughout the site from a menu.) When creating the menu item, make sure the type matches the component and view. The alias will then be whatever is entered in the alias box just below the title.

The one issue you may run into with this is that a component may not have a menu type for a particular view. In that case, you you would need to add the necessary metadata.xml file to the view (which again would be much easier than renaming the component!). A good tutorial for that can be found here: http://docs.joomla.org/Adding_view_layout_configuration_parameters.

0
On

You can create custom URLs by developing a router for your component.

There is very good documentation for it here.