Ulti Clocks content

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

JOOMLABOTTOM sand Website 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

Lun

27

Avr

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=
 Cette adresse email est protégée contre les robots des spammeurs, vous devez activer Javascript pour la voir.
 " 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!
LAST_UPDATED2
 

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:
  The word for verification.
Lowercase letters only with no spaces.

The word for verification.<br/>Lowercase letters only with no spaces.
Word verification:

Titre:
Comment:
Comments (1)
Thanks a lot!
1 Vendredi, 12 Février 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

Our Recommended Reading

For those interested in extending their 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.


Joomla! Social Networking with JomSocial
Joomla! Social Networking
with JomSocial

by Kwasi Boateng & Beatrice A. Boateng.
Joomla! 1.5 Multimedia
Joomla! 1.5 Multimedia
by Allan Walker.


Building job sites with Joomla!
Building job sites with Joomla!
by Santonu Kumar Dhar.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide
Joomla! Template Design: 2nd Edition
Create your own professional-quality
templates with this fast, friendly guide
by Tessa Blakeley Silver.
Magento: Beginner's Guide
Magento: Beginner's Guide by William Rice
is a must for anyone trying the
open-source e-Commerce solution.

Read the review

object-oriented-javascript-applications-libraries
Object-Oriented JavaScript by
Stoyan Stefanov gives you a very
comprehensive grounding in
the latest Javascript techniques.

Read the review
Joomla! Web Security
Joomla! Web Security
by Tom Canavan.

Joomla 1.5 Top Extensions Cookbook
Joomla 1.5 Top Extensions Cookbook by
Suhreed Sarkar is an ideal and concise round up of the extensions available for the Joomla! system.

Read the review

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.

Mastering Joomla! 1.5 Extension and Framework Development
Mastering Joomla! 1.5 Extension and
Framework Development : 2nd Edition

by James Kennard.
Read the review

Building job sites with Joomla!
Building job sites with Joomla!
by Santonu Kumar Dhar.
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! 1.5 Site Blueprints Joomla! 1.5 Site Blueprints
by Timi Ogunjobi.

Joomla! 1.5 JavaScript jQuery Joomla! 1.5 JavaScript jQuery
by Jose Argudo Blanco.
Read the review
Joomla! Social Networking with JomSocial Joomla! Social Networking with JomSocial
by Kwasi Boateng & Beatrice A. Boateng.

Joomla! 1.5 Multimedia Joomla! 1.5 Multimedia
by Allan Walker.

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 : 2nd Edition
by James Kennard.

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

Magento: Beginner's Guide
Magento: Beginner's Guide by William Rice
is a must for anyone trying the
open-source e-Commerce solution.

Read the review

JOOMLABOTTOM



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



Website 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