Friday, June 14, 2013

Add custom address city user profile fields joomla 2.5

If you want to add basic location fields in user profile both for registration and profile like city, country, address, postcode you don't have to install any plug-ins .. Joomla 2.5 gives the option to do that by default :)

Here is how it goes:

Step 1: Go to 'Extensions' -> 'Plug in Manager'
Step 2: Search 'Profile'
Step 3: Enable the plug in called 'User - Profile', its disabled by default.

Step 4: Click on plugin and from right menu select the fields you want.
Step 5: Save & Close and you are done :)

Monday, June 10, 2013

Disable right click on link anchor a tag

I have a link that I use a jQuery plugin to open in a popup window and that's how it is to be used. So in order to prevent users to right click and open it in a new window I wanted to disable right click on my anchor tag.. the solution is simple.. add 'oncontextmenu="return false"'

<a href='myLink.php' oncontextmenu="return false">Click me</a>

View page / popup without template Joomla 2.5

So I wanted to create a popup in my custom Joomla component that is basically a whole page in itself not an alert box so I needed to create a page without template (header footer) showing and just what I want.

For example: <a href='index.php?option=my_component&view=popup_page'>Click here</a>

(I used jQuery plugin to open it up in a popup instead of new page)
To view this page without template, all you need to do is simply add '&tmpl=component', so in the above case the URL will simply become:

For example: <a href='index.php?option=my_component&view=popup_page&tmpl=component'>Click here</a>

Hope it helps someone :)