简体   繁体   English

如何在joomla cms中显示文章? (在自己的html模板中)

[英]How to display articles in joomla cms? (in own html template)

How to display articles in joomla cms? 如何在joomla cms中显示文章? (in own html template) (在自己的html模板中)

My try: 我的尝试:

    <positions>
            <position>articles</position>
    </positions>

index.php: index.php文件:

<jdoc:include type="modules" name="articles" />

but nothing is displayed. 但没有显示任何内容。

You can't directly show an article in the template. 您不能直接在模板中显示文章。 The template defines positions for modules and where the component output goes. 模板定义模块的位置以及组件输出的位置。 How the module positions are filled and what will be shown withing the component container is up to Joomla and how you set the modules, menu items and everything. 如何填充模块位置以及组件容器将显示什么内容取决于Joomla,以及如何设置模块,菜单项和所有内容。

Usually articles are shown by the component com_content , that means an article is shown within the component container (the main part of your site). 通常,文章由com_content组件显示,这意味着文章在组件容器(网站的主要部分)内显示。 However you could use an extension which allows to put an article into a module position. 但是,您可以使用扩展名,该扩展名允许将文章放置在模块位置。 Then you enable this module and assign it to a module position. 然后启用该模块并将其分配到模块位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM