2render pages and how to render clean jdoc:component

21 views
Skip to first unread message

SfX

unread,
Aug 1, 2016, 9:45:21 PM8/1/16
to Gantry Framework Developers
Hello, i have a problem..  i`m using & gantry 4 & Virtuemart  3.0.17.4  & !joomla 3.6.0 
i`m trying output clean mainbody section <jdoc:include type="component" />   without divs my components - virtuemart and com_customfilters
Joomla or gantry at  First page loads NOT CLEAN STYLE, but i try load clean style....

very unusual that at first when the page first loads generated Layout 'NOT CLEAN STYLE', and the fact that when the page is Reloaded again, the code works,

##    i try overwrite modify gantry at  /html/layouts/body_mainbody.php

if($menuid !==151 && JFactory::getApplication()->input->get('option') !=='com_customfilters' && JFactory::getApplication()->input->get('option') !=='com_virtuemart')
{           // #######  CLEAN STYLE
                   
<jdoc:include type="component" />
}   else   {  //  ###### NOT CLEAN STYLE //
     
<div class="rt-component-block rt-block">   // - I cant remove it  on FIRST PAGE LOAD.
               
<div id="rt-mainbody"><div class="component-content"><jdoc:include type="component" /></div></div>
   
</div>
}

At stackoverflow i read : You might want to add a few more checks to make sure that the current component and view (JFactory::getApplication()->input->get('view')) is also not the same as the menu's view ($menu->getActive()->view)
But any solutions not help me,  Please help Solve this problem, thanks!!

You can try put his code in /html/com_virtuemart/category/default.php
and to /html/layouts/body_mainbody.php
Tottally need to disable cashing for test it.. Browsers cache cleaner  http://singleclickapps. com/cleaner/

 <?  echo $_SERVER['REQUEST_URI']. ' :: <br>'; ?><code><b>########### GRIDLIST --- ##</b><?
 $itemId
= JFactory::getApplication()->input->getInt('Itemid');
 echo
"<br>itemId ".$itemId."<br> opt";
if(JRequest::getVar('view') !=='') { echo "1JRequest::getVar('view') - ".JRequest::getVar('view'); }
if(JRequest::getVar('option') !=='') { echo "<br>2JRequest::getVar('option') - ".JRequest::getVar('option'); }
if(JRequest::getCmd('option')!=='') { echo "<br>3JRequest::getCmd('option') - ".JRequest::getCmd('option'); }
if(JRequest::getCmd('view') !==''){ echo "<br>4JRequest::getCmd('view') - ".JRequest::getCmd('view'); }
if(JFactory::getApplication()->input->get('option') !==''){ echo "<br>5JFactory::getApplication()->input->get('option') - ".JFactory::getApplication()->input->get('option'); }
if(JFactory::getApplication()->input->get('view') !=='') { echo "<br>6JFactory::getApplication()->input->get('view') - ".JFactory::getApplication()->input->get('view'); }
?></code>

and can set .htaccess

<IfModule mod_headers.c>
   RequestHeader unset Proxy
</IfModule>
<IfModule mod_headers.c>
   Header set Cache-Control "no-store, no-cache"
 Header append Cache-Control "no-store, no-cache, must-revalidate"
</IfModule>
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "now"
</IfModule>

tpl/index.php nocache
if (JURI::base() == 'http://domain.com/' || $_SERVER['REQUEST_URI'] =='/price/xls/?tmpl=component' || $_SERVER['REQUEST_URI']=='/price/xls/' || JFactory::getApplication()->input->get('option')=='com_virtuemart' || JFactory::getApplication()->input->get('option')=='com_customfilters') {
echo
'<meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="pragma" content="no-cache" />';
header
("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " .gmdate("D, d M Y H:i:s")." GMT");
header
("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header
("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache");
header
("Connection: close");
session_cache_limiter
("must-revalidate");
}








Message has been deleted

SfX

unread,
Aug 1, 2016, 10:09:51 PM8/1/16
to Gantry Framework Developers
 Understand code of renderrer maybe ::
mark('afterLoad') : null;  // Instantiate the application.
$app
= JFactory::getApplication('site');  // Initialise the application.
$app
->initialise();  // Mark afterIntialise in the profiler.
JDEBUG
? $_PROFILER->mark('afterInitialise') : null;  // Route the application.
$app
->route();  // Mark afterRoute in the profiler.
JDEBUG
? $_PROFILER->mark('afterRoute') : null;  // Dispatch the application.
$app
->dispatch();  // Mark afterDispatch in the profiler.
JDEBUG
? $_PROFILER->mark('afterDispatch') : null;  // Render the application.
$app
->render();  // Mark afterRender in the profiler.
JDEBUG
? $_PROFILER->mark('afterRender') : null;  // Return the response.
echo $app
;
Reply all
Reply to author
Forward
0 new messages