簡體   English   中英

Joomla 模塊未顯示在自定義模板上

[英]Joomla modules not showing on custom template

所以我最近創建了一個自定義模板並放入模塊並將其上傳到我的服務器。 當我加載頁面時,它會顯示模板布局,但是當我創建一個模塊以插入模塊位置時,這些模塊中的內容不會出現在我的頁面上。 我似乎可以找到錯誤的來源。 有人能幫我嗎?

php

<?php defined( '_JEXEC' ) or die( 'Restricted access' ); ?>
<!doctype HTML public "-//W3C//DTD HTML 5.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml" 
   xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
  <head>

    <jdoc:include type="head" />

    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
        integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

    <!-- custom css -->
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/style.css">

    <title>Site</title>
</head>

<body>
    <!-- navbar area -->
    <div class="nav-area">
        <!-- top details -->

        <!-- navbar menu -->
        <nav class="navbar navbar-expand-lg navbar-light bg-light w-100">
            <div class="container">
                <a class="navbar-brand" href=".">Brand</a>
                <button class="navbar-toggler" type="button" data-toggle="collapse"
                    data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
                    aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <jdoc:include type="module" name="menu" />
                </div>
                <button class="btn btn-orange btn-lg">Request a Qoute</button>
            </div>
        </nav>
    </div>

    <!-- component -->
    <div class="component-area">
        <div class="container">
            <jdoc:include type="component" />
        </div>
    </div>

    <!-- call to action -->
    <div class="call">
        <jdoc:include type="module" name="call2action" />
    </div>

    <!-- what drives us -->
    <div class="drive">
        <jdoc:include type="module" name="drive" />
    </div>

    <!-- our experience -->
    <div class="experience">
        <jdoc:include type="module" name="experience" />
    </div>

    <!-- solutions we offer -->
    <div class="solutions">
        <jdoc:include type="module" name="solutions" />
    </div>

    <!-- call out -->
    <div class="callout">
        <jdoc:include type="module" name="call-out" />
    </div>

    <!-- contact area -->
    <div class="contact">
        <jdoc:include type="module" name="contact" />
    </div>

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
        integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous">
    </script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
        integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous">
    </script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
        integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous">
    </script>

    <script type="text/javascript">
        $.noConflict();
        jQuery(document).ready(function ($) {
            // Code that uses jQuery's $ can follow here.

            var s = $(".nav-area");
            var pos = s.position();
            $(window).on('scroll', function () {
                var windowpos = $(window).scrollTop() > 1;
                if (windowpos > pos.top) {
                    s.addClass("fixed");
                } else {
                    s.removeClass("fixed");
                }
            });
        });
    </script>
</body>

</html>

模板詳情

<?xml version="1.0" encoding="utf-8"?>
<extension version="3.9" type="template">
    <name>Site</name>
    <creationDate>2020-02-06</creationDate>
    <author>Me</author>
    <authorEmail>site@site.co</authorEmail>
    <authorUrl>site.co</authorUrl>
    <copyright>Site</copyright>
    <license>GNU/GPL</license>
    <version>1.1.2</version>
    <description>Site</description>
    <files>
        <filename>index.html</filename>
        <filename>index.php</filename>
        <filename>templateDetails.xml</filename>
        <folder>css</folder>
        <folder>img</folder>
    </files>
    <positions>
        <position>menu</position>
        <position>call2action</position>
        <position>drive</position>
        <position>experience</position>
        <position>solutions</position>
        <position>call-out</position>
        <position>contact</position>
    </positions>
     <config>
        <fields name="params">
            <fieldset name="general" label="General">
                <field name="copyright" type="text" label="Copyright Info" description="Enter your Copyright Information" />
            </fieldset>
        </fields>
    </config>
</extension>

錯誤出在我的jdoc類型中。 而不是<jdoc:include type="module" name="menu" />, its supposed to be ```。 它缺少一個's'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM