Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将现有Joomla模板修改为Joomla 3.x模板?_Php_Templates_Joomla_Joomla3.0 - Fatal编程技术网

Php 如何将现有Joomla模板修改为Joomla 3.x模板?

Php 如何将现有Joomla模板修改为Joomla 3.x模板?,php,templates,joomla,joomla3.0,Php,Templates,Joomla,Joomla3.0,我是Joomla的初学者! 我必须将Joomla 2.5.x版本的站点升级到Joomla的最新版本。 我已经检查了版本2.5.19的所有现有组件/模块/插件的兼容性,它们在Joomla 3.x中都是兼容的。 唯一的问题是模板。 我只是不知道如何处理和从哪里开始修改它 以下是my templateDetails.xml的一些行: 下面是我的index.php文件的一些行: <head> <link rel="shortcut icon" href="<?php echo $

我是Joomla的初学者! 我必须将Joomla 2.5.x版本的站点升级到Joomla的最新版本。 我已经检查了版本2.5.19的所有现有组件/模块/插件的兼容性,它们在Joomla 3.x中都是兼容的。 唯一的问题是模板。 我只是不知道如何处理和从哪里开始修改它

以下是my templateDetails.xml的一些行:

下面是我的index.php文件的一些行:

<head>
<link rel="shortcut icon" href="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/images/favicon.ico"/>
<meta http-equiv="Content-Type" content="text/html;" />
<link href="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/css/template_css.css" rel="stylesheet" type="text/css" media="all"/>
<!-- <link href="css/template_css.css" rel="stylesheet" type="text/css" media="all"/> -->
<jdoc:include type="head" />
<meta name="verify-v1" content="PynT0gVSXBh484xuIjQakd0YZS+sHAYmOK+CRTa1aJI=" />
<script type="text/javascript" src="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/flashobject.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-32944659-1']);
    _gaq.push(['_trackPageview']);

    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
     })();

    jQuery.noConflict();
...
...
...
<body>
<div class="out">
    <div class="main">
    <!--Toparea Start-->
        <div class="top">
          <div class="logo_space">
              <div class="boxlogin"><jdoc:include type="modules" name="user2" /></div>
          </div>
          <div class="header">
            <img src="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/images/img_header.jpg" alt="sfondo_header" align="top" style="float:left;"  />
            <div id="flash" style="float:right; width:550px; height:132px;"></div>
            <script type="text/javascript">
                var fo = new FlashObject("<?php 
                    $flashPath = $app->getCfg( 'live_site' )."templates/".$this->template."/flash/animazione.swf";
                    echo $flashPath; 
                ?>", "Menu", "550", "132", "8", "#FFFFFF", "transparent");
                fo.write("flash");
            </script>

            <!-- <img src="<?php echo $app->getCfg( 'live_site' ); ?>templates/<?php echo $this->template ?>/images/img_headerright.jpg" alt="sfondo_header" align="top" style="float:right;" width="550" height="132"  /> -->
            <!-- <div class="boxlogin"></div> -->
        </div>

        <div class="topmenu">
            <?php if ($this->countModules( "top" )) { ?>
                <jdoc:include type="modules" name="top" />
            <?php } ?>
        </div>
    </div>
...
...
...

欢迎任何建议

好的,看看你的代码,这里有几件事

首先,XML文件很好,不需要任何更改

要在noConflict模式下导入jQuery并确保只执行一次,应替换以下内容:

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
$app->getCfg('live_site')
完成后,可以删除以下代码:jQuery.noConflict

要从configuration.php文件中获取值,不要使用$app->getCfg,因为它已被弃用。而是使用$app->get。因此,在您的情况下,请替换此:

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
$app->getCfg('live_site')
用这个

$app->get('live_site');

除此之外,我看不到代码有任何其他问题。

模板中到底需要更新什么?不知道任何细节就很难说。可能有多个代码段需要更改或可能什么都不需要正如@Lodder所说,可能有多个代码段需要更改或可能什么都不需要。几周前我更新了一个Joomla网站,我在一些组件上遇到了问题,但是这个模板工作得很好。所以,如果你愿意,你应该做的是在测试环境中更新网站,以及你可能遇到的任何具体错误的地址,如果有的话。我已经编辑了我的问题。。。正如我所说,我只是不知道从哪里开始,首先检查什么…我还尝试升级站点,后端部分还可以,但前端显示错误您需要修改CSS,您的索引应该可以。我只是做了您建议的更改,但我得到了一个500-JHtmlBehavior::mootools not foundah,我在您的问题中没有看到该代码,请将代码中的那一行替换为JHtml::u'behavior.framework'Ok通过替换JHtmlBehavior::mootools解决了问题;使用JHtml:::uu'behavior.framework';