I have a requirement to pass parameters from the joomla calling URL to the wrapper iframe URL.
I had a look around to see if I could do this and found this thread https://stackoverflow.com/questions/12200934/pass-value-in-url-to-wrapped-url-in-joomla-2-5 for J2.5 version, which suggests customising the core wrapper files to achieve this
Find $url = $params->def('url', '');
Then add the following after it (as outlined in Abid's link)
foreach ($_GET as $key => $value) {
if ($key<>"option" && $key<>"Itemid") {
$url.=(strpos($url,"?")) ? "&" : "?";
$url.="$key=$value";
}
}
So that is parsing the calling URL and adding the params to the of it
But customising core is generally a bad idea. I was wondering if it might be possible to achieve the same outcome using a template override?
I have created an override from /html/com_wrapper/wrapper/default.php
In there the iframe code is as follows:
<iframe <?php echo $this->wrapper->load; ?>
id="blockrandom"
name="iframe"
src="<?php echo $this->escape($this->wrapper->url); ?>"
width="<?php echo $this->escape($this->params->get('width')); ?>"
height="<?php echo $this->escape($this->params->get('height')); ?>"
scrolling="<?php echo $this->escape($this->params->get('scrolling')); ?>"
frameborder="<?php echo $this->escape($this->params->get('frameborder', 1)); ?>"
class="wrapper<?php echo $this->pageclass_sfx; ?>">
<?php echo JText::_('COM_WRAPPER_NO_IFRAMES'); ?>
</iframe>
So is it possible to add that same foreach logic into this code ?
And would it work?