基于点击加载模板

hi i am a novice at coding so need any help possible. i am using joomla and a component built for joomla. I want to make a template load in place of existing template when a link is clicked. That link would load the below statement. over existing page.

   <?php echo $this->loadTemplate('common1'); ?> 

An easy way to switch templates via a url would be to simply include the template name in a url parameter as shown below:

http://website.com/index.php?template=myTemplateName

Where myTemplateName is one of the templates installed on your joomla site.