...it is no problem to change rendering position ...
The only thing that has to be done (if using my change right now) is moving
Code: Select all
// check layout for list mode sections or detail view
if(strpos($content['all'], '_LIST_MODE')) {
$content['all'] = replace_tmpl_section( ($content['list_mode'] ? 'ELSE_LIST_MODE' : 'IF_LIST_MODE') , $content['all']);
$content['all'] = str_replace(array('<!--ELSE_LIST_MODE_START//-->', '<!--ELSE_LIST_MODE_END//-->', '<!--IF_LIST_MODE_START//-->', '<!--IF_LIST_MODE_END//-->'), '', $content['all']);
}
from bottom of the page (end of rendering process) after the position where all blocks including main layout are merged to final template. And this happens around line 477 - so put it before the line
Code: Select all
// {SHOW_CONTENT:MODE,id[,id[,...]]}
Then there will be no double calls anymore because all "double" are replaced before global rendering starts.
Your solution in most cases will result in more work. Because in general there will be small differences between article and listing view.
For complexer situations I really recommend using frontend_render scripts - and remember the simple value
which has two possible states: TRUE or FALSE and can be used to do custom processings...
And additional to frontend_render there is a really easy way to inject HTML <head> by custom code using:
- this is a global array. So any new line or code section in <head> can be used like this:
Code: Select all
$block["htmlhead"][] = ' <script src="'.TEMPLATE_PATH.'inc_js/mycustom.js" type="text/javascript"></script>';
or if you need have to combine multiple string sections there:
Code: Select all
$block["htmlhead"]['myjs'] = ' <script type="text/javascript" language="javascript">'.LF.SCRIPT_CDATA_START.LF;
$block["htmlhead"]['myjs'] .= ' loadMyJSFuntion();'.LF;
$block["htmlhead"]['myjs'] .= SCRIPT_CDATA_END.LF.' </style>';
Kinda like functionality is available for CSS (above solution can be used too to enhance CSS):
Code: Select all
$block['css']['additional_css'] = 'mycss/special.css';
This will result in loading your custom CSS from directory
using @import.
Hehe - and again: I recommend using UFO which is part of distribution.
Oliver