web design, England, Britain, UK, belgium
 
Ulti Clocks content

How to pass Joomla 1.0 parameters to an iframe (wrapper) page

JOOMLABOTTOM sand Web Design, Joomla, VirtueMart, Templates, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.
params, url, username, def, row, emailadd, wrapper, joomla, email, line, menu, parameters, page, variables, add, com, mainframe, src, iframe, file, components, user, auto, button, pass, root, change, php, using, showwrap, height, function, append, address, array, used, construction, like, session, pulled

Home Joomla - VirtueMart Joomla & VM How To's How to pass Joomla 1.0 parameters to an iframe (wrapper) page
Bericht
  • Keine Suchergebnisse.

maa

27

apr

How to pass Joomla 1.0 parameters to an iframe (wrapper) page

  • Joomla 1.0
  • com_wrapper

If we are using an iframe (wrapper) within our content we sometimes need to pass Joomla parameters to the called page.

If were still using Joomla 1.0 we have to change the core files.

Joomla com_wrapper parameters Open in your editor the file - joomla_root/components/com_wrapper/wrapper.php and go to line 24.
Add the $my parameter to the showWrap function
function showWrap( $option ) {
	global $database, $Itemid, $mainframe, $my;
Then around line 37 set the 2 $username and $emailaddress variables -
        $menu = $mainframe->get( 'menu' );
	$params = new mosParameters( $menu->params );
	$params->def( 'back_button', $mainframe->getCfg( 'back_button' ) );
	$params->def( 'scrolling', 'auto' );
	$params->def( 'page_title', '1' );
	$params->def( 'pageclass_sfx', '' );
	$params->def( 'header', $menu->name );
	$params->def( 'height', '500' );
	$params->def( 'height_auto', '0' );
	$params->def( 'width', '100%' );
	$params->def( 'add', '1' );
	$url = $params->def( 'url', '' );
	$username = $my->username;
	$emailadd = $my->email;
Then add them to the $row array around line 49 -
 
} else {
            $row->url = $url;
            $row->username = $username;
            $row->emailadd = $emailadd;
        }
    } else {
        $row->url = $url;
        $row->username = $username;
        $row->emailadd = $emailadd;
    } 
 
We need to pass these new variables to the url construction in file -
joomla_root/components/com_wrapper/wrapper.php at line 49.
 
Change from     
src="<?php echo $row->url; ?>"
 
to
 
src="<?php echo $row->url."?username=".
     $row->username."&email=".
     $row->emailadd; ?>"
 

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=
  Dit e-mailadres is beveiligd tegen spambots, u heeft JavaScript nodig om het te kunnen bekijken
 " 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.


Add this page to your favorite Social Bookmarking websites
Digg! Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! Slashdot! Technorati! StumbleUpon! Spurl! Newsvine! Furl! Fark! Yahoo! Netvouz! Mister-Wong! RawSugar! Ma.gnolia! Squidoo! DZone! Swik!
Laatste aanpassing op dinsdag 05 mei 2009 11:54 Read : 5646 times
 
Comments (1)
Thanks a lot!
1 vrijdag 12 februari 2010 11:00
Thomas
Hi,

tanks a lot for your help, it's just what i've been searching for. But i think there's a little typo in your article, IMHO it should be:

We need to pass these new variables to the url construction in file -
joomla_root/components/com_wrapper/wrapper.html.php at line 49.

instead of:
We need to pass these new variables to the url construction in file -
joomla_root/components/com_wrapper/wrapper.php at line 49.

Thomas

Add your comment

BoldItalicUnderlineStrikethroughSubscriptSuperscriptEmailImageHyperlinkOrdered listUnordered listQuoteCodeHyperlink to the Article by its id
Very HappySmileWinkSadSurprisedShockedConfusedCoolLaughingMadRazzEmbarrassedCrying or Very SadEvil or Very MadTwisted EvilRolling EyesExclamationQuestionIdeaArrowNeutralMr. GreenGeekUber Geek
Your name:
Titel:
Comment:

Latest Articles

Paypal Donation

If you use this module on your site please donate a small amount.
Any donation amount appreciated.

VM Live Product Search

Recommended Reading

For those interested in extending there knowledge of Joomla! & VirtueMart Packt Publishing has an excellent range of help & how to books.
Listed below are some I can recommend.
Simply click on the images to be taken directly to their web shop.

Learning Joomla! 1.5 Extension Development Learning Joomla! 1.5 Extension Development
by Joseph L. LeBlanc.
Read the review
Joomla! E-Commerce with VirtueMart Joomla! E-Commerce with VirtueMart
by Suhreed Sarkar.
Read the review
Joomla! Web Security Joomla! Web Security
by Tom Canavan.

Mastering Joomla! 1.5 Extension and Framework Development Mastering Joomla! 1.5 Extension and Framework Development
by James Kennard.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide
by Tessa Blakeley Silver.

JOOMLABOTTOM



How to pass Joomla 1.0 parameters to an iframe (wrapper) page



Web Design, Joomla, VirtueMart, Templates, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.


params, url, username, def, row, emailadd, wrapper, joomla, email, line, menu, parameters, page, variables, add, com, mainframe, src, iframe, file, components, user, auto, button, pass, root, change, php, using, showwrap, height, function, append, address, array, used, construction, like, session, pulled