Hello everyone, I try use in URL tmpl=component to show only the component view, but not work in Joomla! 3.2, anybody here know about how proceed to make this works?
http://forum.joomla.org/viewtopic.php?f=706&t=821401&p=3089673#p3089673
Have you tried something like tmpl=modal
with a file named modal.php in the root of your site templates directory?
Hello @betweenbrain , first thanks to try help me.
If have time take a look in this files:
libraries\cms\application\administrator.php
libraries\cms\application\site.php
The method render() of administrator.php
/**
* Rendering is the process of pushing the document buffers into the template
* placeholders, retrieving data from the document and pushing it into
* the application response buffer.
*
* @return void
*
* @since 3.2
*/
protected function render()
{
// Get the JInput object
$input = $this->input;
$component = $input->getCmd('option', 'com_login');
$file = $input->getCmd('tmpl', 'index');
if ($component == 'com_login')
{
$file = 'login';
}
$this->set('themeFile', $file . '.php');
// Safety check for when configuration.php root_user is in use.
$config = JFactory::getConfig();
$rootUser = $config->get('root_user');
if (property_exists('JConfig', 'root_user')
&& (JFactory::getUser()->get('username') == $rootUser || JFactory::getUser()->id === (string) $rootUser))
{
$this->enqueueMessage(
JText::sprintf(
'JWARNING_REMOVE_ROOT_USER',
'index.php?option=com_config&task=application.removeroot&' . JSession::getFormToken() . '=1'
),
'notice'
);
}
parent::render();
}
The method render() of site.php
/**
* Rendering is the process of pushing the document buffers into the template
* placeholders, retrieving data from the document and pushing it into
* the application response buffer.
*
* @return void
*
* @since 3.2
*/
protected function render()
{
switch ($this->document->getType())
{
case 'feed':
// No special processing for feeds
break;
case 'html':
default:
$template = $this->getTemplate(true);
$file = $this->input->get('tmpl', 'index');
if (!$this->get('offline') && ($file == 'offline'))
{
$this->set('themeFile', 'index.php');
}
if ($this->get('offline') && !JFactory::getUser()->authorise('core.login.offline'))
{
$this->setUserState('users.login.form.data', array('return' => JUri::getInstance()->toString()));
$this->set('themeFile', 'offline.php');
$this->setHeader('Status', '503 Service Temporarily Unavailable', 'true');
}
if (!is_dir(JPATH_THEMES . '/' . $template->template) && !$this->get('offline'))
{
$this->set('themeFile', 'component.php');
}
// Ensure themeFile is set by now
if ($this->get('themeFile') == '')
{
$this->set('themeFile', 'index.php');
}
break;
}
parent::render();
}
What's happening is that the file isn't being set correctly for all cases in the site application. There's a bunch of conditionals to set the file but not one that would match for component, so that needs to be handled.
Just needs a patch, preferably before we tag beta.
Change https://github.com/joomla/joomla-cms/blob/master/libraries/cms/application/site.php#L705 to read $this->set('themeFile', $file . '.php');
and it should be good to go.
Just needs a patch, preferably before we tag beta.
Any ETA for that?
Someone patch the line as I suggested and it would most likely be merged today.
Done!
Thanks a lot @betweenbrain
Thank you!
Hello, I've just installed a new version of joomla 3.2 (final version) and the modules I wish to have (assigned only to home page menu) only in the front page are displayed always every where. I investigated to figure out why is not working correctly, and for now I did not find any answers.
Does anybody have the same issues?
Labels |
Added:
?
|
||
Build | ⇒ | staging |
I found the problem, in backend works fine but in frontend not works because the JApplicationAdministrator class have a method called render() with this code:
The JApplicationSite class not have the same code in render() method. If I put this code in JApplicationSite::render() works fine.
Is a security problem use the tmpl=component?