Does using paramaters slow the page load time? - Joomla! Forum - community, help and support
hi guys
in custom template have series of parameters used define site widths, title, logo , on set in templates admin settings.
i have following @ top of index.php file template, php learner unsure of having on page slow loading of page on every load or not? if affect load, minor or more? have suggestions imporve or replace code in use? should place code in external file instead?
and within template have calls data like
thanks
gw
in custom template have series of parameters used define site widths, title, logo , on set in templates admin settings.
i have following @ top of index.php file template, php learner unsure of having on page slow loading of page on every load or not? if affect load, minor or more? have suggestions imporve or replace code in use? should place code in external file instead?
code: select all
/* parameters */
$logo = $this->params->get('flexi_logo');
$sitetitle = $this->params->get('flexi_sitetitle');
$sitedescription = $this->params->get('flexi_sitedescription');
$htmltype = $this->params->get('flexi_htmltype');
$template_width = $this->params->get('flexi_template_width');
$leftcolumn_width = $this->params->get('flexi_leftcolumn_width');
$rightcolumn_width = $this->params->get('flexi_rightcolumn_width');
$content_padding = $this->params->get('flexi_content_padding');
$leftcolumn_count = (($this->countmodules('pos-leftcolumn-one')) ? 1 : 0) + (($this->countmodules('pos-leftcolumn-two')) ? 1 : 0);
$rightcolumn_count = (($this->countmodules('pos-rightcolumn-one')) ? 1 : 0) + (($this->countmodules('pos-rightcolumn-two')) ? 1 : 0);
/* column numbers , styles */
$csstemplate_width = 'width: ' . $template_width . 'px;';
$cssmenuwrap_width = 'width: ' . ($template_width) . 'px;';
$cssmainmenu_width = 'width: ' . ($template_width - 5) . 'px;'; /* -10 ends of menu style */
$cssshopmenu_width = 'width: ' . ($template_width - 5) . 'px;'; /* -10 ends of menu style */
$cssleftcolumn_width = ($leftcolumn_count > 0) ? $leftcolumn_width : 0;
$cssrightcolumn_width = ($rightcolumn_count > 0) ? $rightcolumn_width : 0;
$csscontent_width = $template_width - $cssleftcolumn_width - $cssrightcolumn_width;
$csscontent_style = 'margin: 0 '. $cssrightcolumn_width . 'px 0 ' . $cssleftcolumn_width . 'px;';
$cssleftcolumn_style = 'float:left;width:' . ($cssleftcolumn_width - 5). 'px;margin-left:-' . ($template_width - 5) . 'px;';
$cssrightcolumn_style = 'float:left;width:' . ($cssrightcolumn_width - 5) . 'px;margin-left:-' . ($cssrightcolumn_width - 5) . 'px;';
/* check positions , add styles */
$showcase_count = (($this->countmodules('pos-showcase-one')) ? 1 : 0) + (($this->countmodules('pos-showcase-two')) ? 1 : 0) + (($this->countmodules('pos-showcase-three')) ? 1 : 0);
$showcase_style = ($showcase_count > 0) ? 'width:' . $template_width/$showcase_count . 'px;' : '';
$contenttop_count = (($this->countmodules('pos-content-topleft')) ? 1 : 0) + (($this->countmodules('pos-content-topright')) ? 1 : 0);
$contenttop_style = ($contenttop_count > 0) ? 'width:' . $csscontent_width/$contenttop_count . 'px;' : '';
$contentbottom_count = (($this->countmodules('pos-content-bottomleft')) ? 1 : 0) + (($this->countmodules('pos-content-bottomright')) ? 1 : 0);
$contentbottom_style = ($contentbottom_count > 0) ? 'width:' . $csscontent_width/$contentbottom_count . 'px;' : '';
$subshowcase_count = (($this->countmodules('pos-subshowcase-one')) ? 1 : 0) + (($this->countmodules('pos-subshowcase-two')) ? 1 : 0) + (($this->countmodules('pos-subshowcase-one')) ? 1 : 0);
$subshowcase_style = ($subshowcase_count > 0) ? 'width:' . $template_width / $subshowcase_count . 'px;' : '';
$footer_count = (($this->countmodules('pos-footerleft')) ? 1 : 0) + (($this->countmodules('pos-footerright')) ? 1 : 0);
$footer_style = ($footer_count > 0) ? 'width:' . $template_width / $footer_count . 'px;' : '';
$footerarea_count = (($this->countmodules('pos-footerarea-one')) ? 1 : 0) + (($this->countmodules('pos-footerarea-two')) ? 1 : 0) + (($this->countmodules('pos-footerarea-three')) ? 1 : 0) + (($this->countmodules('pos-footerarea-four')) ? 1 : 0);
$footerarea_style = ($footerarea_count > 0) ? 'width:' . $template_width / $footerarea_count . 'px;' : '';
$copycredit_count = (($this->countmodules('pos-copyright')) ? 1 : 0) + (($this->countmodules('pos-credits')) ? 1 : 0);
$copycredit_style = ($footer_count > 0) ? 'width:' . $template_width / $copycredit_count . 'px;' : '';
and within template have calls data like
code: select all
style="<?php echo $cssmainmenu_width; ?>"thanks
gw
Comments
Post a Comment