Thu 23 Apr |
|
If we are using an iframe (wrapper) within our content we sometimes need to pass Joomla parameters to the called page. By using Joomla's template override system we don't have to touch any core files. First of all create the needed folder structure in your own template folder. So in this case it would be joomla_root/templates/your_template/html/com_wrapper/wrapper . Then copy into the the new wrapper folder the file joomla_root/components/com_wrapper/views/wrapper/tmpl/default.php Now we need to make a few changes to this file that we have copied. Directly under line 2 (file access check) add this - $user =& JFactory::getUser();Then at line 24 change the code to read - src="<?php echo $this->wrapper->url."?username=".$user->username."&email=".$user->email; ?>"In this case it will append the username and email address of the logged in user to the iframe url like so - <iframe id="blockrandom" class="wrapper" height="500" frameborder="0" width="100%" scrolling="auto" align="top" src="http://www.gjcwebdesign.com/joomla-15-virtuemart-11-joomfish-20.html?username=Bert.&email= This e-mail address is being protected from spambots. You need JavaScript enabled to view it " name="iframe">You can send the other parameters such as real name, user id etc as well as session parameters. The parameters can be pulled by normal $_GET["email"] or $_REQUEST["email"] variables in the target page and used as you want. |
Last Updated on Monday, 19 October 2009 15:25 |