我已经成功安装了JOOMLA模板。当我正在浏览网站时,我得到了空白页面。任何人都可以知道模板的问题是什么?
我在下面附上了我的xml和php文件。
这是我的XML文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 3.2//DTD template 1.0//EN"
"http://www.joomla.org/xml/dtd/3.2/template-install.dtd">
<extension version="3.2" type="template" client="site">
<name>Varsha_Mahajan</name>
<author>varsha</author>
<authorEmail>rajeshkalluri26@gmail.com</authorEmail>
<authorUrl>http://www.varshamahajan.com/</authorUrl>
<copyright>© 2013 Varsha Mahajan All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.2.0</version>
<creationDate>November 2013</creationDate>
<description>Main Template For Varsha Mahajan</description>
<files>
<folder>css</folder>
<folder>fonts</folder>
<folder>images</folder>
<folder>js</folder>
<folder>scripts</folder>
<file>favicon.ico</file>
<file>index.html</file>
<file>index.php</file>
<file>template_thumbnail.png</file>
<file>templateDetails.xml</file>
</files>
<positions>
<position>header</position>
<position>slider</position>
<position>footer</position>
</positions>
</extension>
这是我的php文件。
<?php
defined('_JEXEC') or die;
$app = JFactory::getApplication();
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>"
lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?
>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?
>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this-
>template ?>/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this-
>template ?>/css/camera.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this-
>template ?>/css/style.css" type="text/css" />
</head>
<body>
<!-- top-bar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation"
style="background-color:#f8f8f8;">
<jdoc:include type="modules" name="header" style="xhtml" />
</div>
<!-- End top-bar -->
<div id="wrap">
<jdoc:include type="modules" name="slider" style="xhtml" />
</div>
<div id="footer">
<jdoc:include type="modules" name="footer" style="xhtml" />
</div>
</body>
</html>
答案 0 :(得分:0)
是的,我想我可能在这里找到了这个问题。您正在调用$this->template
之类的内容,但它们尚未正确定义。
删除顶部<?php ?>
标记中的所有内容,然后替换为:
defined('_JEXEC') or die;
$params = JFactory::getApplication()->getTemplate(true)->params;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$this->language = $doc->language;
$this->direction = $doc->direction;
看看这对你有什么用。希望它有所帮助
<强>更新强>
我发现了问题。您忘记添加加载组件视图的<jdoc:include type="component" />
。每个页面必须有一个组件,而不仅仅是模块。
因此在index.php中,您的代码将如下所示:
<div id="wrap">
<jdoc:include type="modules" name="slider" style="xhtml" />
<jdoc:include type="component" />
</div>
请同时使用我在答案第一部分提供的代码;)
享受:)