Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Thursday, April 12, 2012

How to get a URL variable in Joomla

If you want to get a variable from URL the command is simply

$id = JRequest::getVar('id');
It will give you the value of 'id' if its in your url like:

http://www.b4blinky.com/index.php?id=1

However if you don't have an 'id' var in URL it will return you NULL, so if you want to have a default value of let's say zero you can use this


$id = JRequest::getVar('id','0');

Especially useful when you want to have some default views etc.

Thursday, March 8, 2012

Set Default Article Category Joomla 2.5

Are you wondering how to set default category joomla 2.5 for the article and can't find it in the article options? Well then you are looking at the wrong place. To set the default category for users who are adding articles from the front end, you can set the default category from the 'Menu Item'... Menu item is the options available for all the options/links added into 'Menu(s)' of Joomla.







When you add a new field in lets say main menu named 'Add Article', you will see that a Menu Item has also been created for it in the new tab called 'Menu Items', once you go into its options you can easily set a default category so users add all articles into the specified category. You can have different default categories for different menu options.