[32]Wrapper Component: Pass parameters/variables via URL

Locked
[Jeb]
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Feb 20, 2008 6:43 pm

[32]Wrapper Component: Pass parameters/variables via URL

Post by [Jeb] » Wed Feb 20, 2008 7:13 pm

1. Summary of Background issue: You are currently unable to pass parameters/variables to an item in a wrapper without the addition of custom php code to the wrapper component. I would like to request the addition of the ability to pass parameters/variables to the Wrapper via a URL. I believe that this would be beneficial as part of the core project itself.

There are many times when a link to a wrapper menu item is used in a content item that may need a specific value passed to through the wrapper to the form. It may be a value specific to the content item itself that doesn't warrant it's own menu item, but simply data required by the form in the wrapper itself.

An example of the usage of this functionality would be a form in a wrapper which requires parameters/variables to be passed to it in order to execute a specific way. Depending on the parameters/variables passed to the form, it may display specific fields and email a specific recipient.

Example Link: http://domain.com/wrapper_link/?formtyp ... t=machine1

2. Overview of Functional Requirements: Have the Wrapper component parse the URL for any passed parameters/variables that are used in the URL.

3. Thoughts on Proposal: This should not affect backward compatibility or change the UI such that training would be required. This would simply allow parameters/variables to be passed through the wrapper via an URL.

finkerssies
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Mar 08, 2008 7:34 pm

Re: Wrapper Component: Pass parameters/variables via URL

Post by finkerssies » Sat Mar 08, 2008 7:44 pm

Hi,

I was desperate to solve this problem as I want to use an external domain check script which passes on parameters by URL. I was lucky to find this component:

http://www.mamboportal.com/component/op ... catid,373/

You may have to remove the folder /components/com_wrapper to install it but it is really worth it. It cost me some time to figure out how to set the wrapper link in a menu but finally my script is fully included in my Joomla website.

Hope it works for you too.

Best regards,
Fin

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by newart » Tue Apr 29, 2008 9:23 am

[Jeb] wrote:3. Thoughts on Proposal: This should not affect backward compatibility or change the UI such that training would be required. This would simply allow parameters/variables to be passed through the wrapper via an URL.
I think this is a good point for this white-paper, also thinking of a component such as the wrapper one as a little limited by the need of new "power & flexibility" like joomla is... ;)
former Q&T WorkGroup Joomla member - Italian Translation Team Member

companymerchant
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Jul 16, 2008 3:59 pm

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by companymerchant » Wed Jul 16, 2008 4:18 pm

Hi

I'm a newb with Joomla so apologies if everyone already realises this but I've had the same problem - trying to pass parameters into the wrapper. After trying to understand component layouts etc, I've modified

components/com_wrapper/view/wrapper/tmpl/default.xml

to have

Code: Select all

<param name="param1" type="text" size="30" default="" label="Optional Param 1" description="PARAMS" />
<param name="param2" type="text" size="30" default="" label="Optional Param 2" description="PARAMS" />
<param name="param3" type="text" size="30" default="" label="Optional Param 3" description="PARAMS" />
after the width and height declarations

and then

components/com_wrapper/view/wrapper/tmpl/default.php

just before the iframe declaration

Code: Select all

   $fullurl=$this->wrapper->url;
   $extraparams="";
   if (strpos("?",$fullurl)===false)
      $extraparams = "?";

   $p1=$this->params->get("param1");
   $p2=$this->params->get("param2");
   $p3=$this->params->get("param3");
   if (isset($p1) && $p1>"")
      $extraparams .= $p1."=".$_REQUEST[$p1]."&";
   if (isset($p2) && $p2>"")
      $extraparams .= $p2."=".$_REQUEST[$p2]."&";
   if (isset($p3) && $p3>"")
      $extraparams .= $p3."=".$_REQUEST[$p3]."&";

  $fullurl .= $extraparams;
and then change the iframe src line to

Code: Select all

        src="<?php echo $fullurl; ?>"
You can then go to the wrapper declaration on the menu and provide 3 parameters to be passed through to the iframe - i.e. "email" and "ticket" could be 2 of the parameters so that when the iframe (wrapper) is created it will retrieve the value of these 2 values from the url.

Hope this helps

Tony Byng
The Company Merchant Limited
http://www.thecompanymerchant.co.uk

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by newart » Tue Jul 29, 2008 10:21 am

thinking of yr solution, maybe is good as a patch or as an option in the next release... why not sending it to the joomla team?
former Q&T WorkGroup Joomla member - Italian Translation Team Member

companymerchant
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Jul 16, 2008 3:59 pm

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by companymerchant » Fri Aug 01, 2008 7:45 am

newart

hi there. In fact I modded the wrapper slightly again to remove the requirement to modify the xml - everything is done in the php script now. In the default.php I just looped through all the GET elements on the URL and passed them straight into the iframe url - after all, if they arent needed, the script running in the iframe would ignore them anyway and this makes for a much simpler mod.

Tony

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by newart » Fri Aug 01, 2008 8:11 am

good! it's an extension by a slight mod... :)
former Q&T WorkGroup Joomla member - Italian Translation Team Member

wahone
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Sep 09, 2008 11:50 pm

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by wahone » Tue Sep 09, 2008 11:55 pm

Found This awsome problem solved.

http://www.joomlaexpert.com/index.php?o ... &Itemid=63

Written by Thomas Kahl
Have you ever needed to pass different parameters to your "wrapped" script?
Here is a flexible solution, which should work with all Wrapper-Items in mambo 4.5.1 & 4.5.2:

1. Make a backup of the file /components/com_wrapper/wrapper.php
2. Open the file in an editor and go to line 35.
3. Search for this text: $url = $params->def( 'url', '' );
4. Insert the following block AFTER the line:

foreach ($_GET as $key => $value) {
if ($key<>"option" && $key<>"Itemid") {
$url.=(strpos($url,"?")) ? "&" : "?";
$url.="$key=$value";
}
}
5. Save the file and test the solution in your browser.

This is for example a link to a special phpBB topic:
http://www.yourdomain.com/index.php?opt ... 110&t=3022
the corresponding URL in the Wrapper configuration is:
http://www.yourdomain.com/phpBB/viewtopic.php
the additional parameter "t" is passed to phpBB:
http://www.yourdomain.com/phpBB/viewtopic.php?t=3022

korb
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Thu Apr 03, 2008 3:58 pm
Contact:

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by korb » Fri Apr 03, 2009 9:10 am

What if I use phpBB SEO? Whould it show SEF URLs? Would it route?

oorzaak
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Tue Feb 17, 2009 2:19 pm

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by oorzaak » Sat May 16, 2009 4:12 pm

@ wahone

Thank you very much for this solution! I use it on a multi lingual (JoomFish) site where visitors are asked to fill out a custom made (php) form. Now the Joomla language variable "lang=.." is passed neatly to the form, so the visitors will see it in the appropriate language. And I can think of many more uses.

Regards, Frits

thesilfieszone
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Tue Nov 18, 2008 6:20 pm

Re: [32]Wrapper Component: Pass parameters/variables via URL

Post by thesilfieszone » Tue Nov 03, 2009 5:32 am

I think this is what I need but i don't understand it. Will this allow me to modify the wrapper so I can zoom in or out of the page? Like if i have a wrapper as my main content with out anything to the LEFT or RIGHT of it, it will view one way.

But if i have a modual next to the wrapper i would like for the wrapper to scale the content so everything fits in the frame without any scrollbars.

can this do that?

Sorry i'm a beginner.


Locked

Return to “Under Review - Archived”