我正在创建自己的 Joomla 模板,但遇到了一些问题。
我正在使用空白模板,并且正在学习本教程:Blank Joomla template with Bootstrap
所以问题:
最初的问题是: 如果我有 2 个模块(span3 和 span 9)并且如果他想在他消失时“span3”span9 占据整个宽度,有可能吗?
教程作者的回答:虽然 php 有简短的 if-else-statement 是可能的:
echo ($this->countModules( 'sidebar' )) ? ('span9') : ('span12');
我的问题:我应该把这个“简单”的代码放在哪里来达到所需的结果?
如果有帮助,以下是脚本在标题中的加载方式:
<head>
<script type="text/javascript" src="/joomla/templates/turdi_designs/js/template.js.php"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="Super User" />
<meta name="description" content="Turdi Designs Descripcion" />
<title>eBay</title>
<link href="http://localhost/joomla/index.php?option=com_content&view=article&id=2&Itemid=466" rel="canonical" />
<link href="/joomla/templates/turdi_designs/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<link rel="stylesheet" href="/joomla/templates/turdi_designs/css/template.css.php?v=1.0.0" type="text/css" />
<script src="/joomla/templates/turdi_designs/js/modernizr.js" type="text/javascript"></script>
<script src="/joomla/templates/turdi_designs/js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEvent('load', function() {
new JCaption('img.caption');
});
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> <!-- mobile viewport -->
<link rel="stylesheet" media="only screen and (max-width: 768px)" href="/joomla/templates/turdi_designs/css/tablet.css" type="text/css" />
<link rel="stylesheet" media="only screen and (min-width: 320px) and (max-width: 480px)" href="/joomla/templates/turdi_designs/css/phone.css" type="text/css" />
<!--[if IEMobile]><link rel="stylesheet" media="screen" href="/joomla/templates/turdi_designs/css/phone.css" type="text/css" /><![endif]--> <!-- iemobile -->
<link rel="apple-touch-icon-precomposed" href="/joomla/templates/turdi_designs/apple-touch-icon-57x57.png"> <!-- iphone, ipod, android -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/joomla/templates/turdi_designs/apple-touch-icon-72x72.png"> <!-- ipad -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/joomla/templates/turdi_designs/apple-touch-icon-114x114.png"> <!-- iphone retina -->
<!--[if lte IE 8]>
<style>
{behavior:url(/joomla/templates/turdi_designs/js/PIE.htc);}
</style>
<![endif]-->
</head>
感谢您的时间!