Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/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
如何设计Joomla 2.5文章';什么是介绍文字?_Joomla_Styles_Customization_Joomla2.5_Article - Fatal编程技术网

如何设计Joomla 2.5文章';什么是介绍文字?

如何设计Joomla 2.5文章';什么是介绍文字?,joomla,styles,customization,joomla2.5,article,Joomla,Styles,Customization,Joomla2.5,Article,这很奇怪,但我通过谷歌搜索joomla风格的介绍文本并没有找到一个真正好的解决方案 我希望当前输出: <div class="item-content"> <p>Intro Text</p> <p>Full Text</p> </div> 介绍文本 全文 替换为: <div class="item-content"> <div class="introtext"><

这很奇怪,但我通过谷歌搜索
joomla风格的介绍文本
并没有找到一个真正好的解决方案

我希望当前输出:

<div class="item-content">
    <p>Intro Text</p>
    <p>Full Text</p>
</div>

介绍文本

全文

替换为:

<div class="item-content">
    <div class="introtext"><p>Intro Text</p></div>
    <div class="fulltext"><p>Full Text</p></div>
</div>

介绍文本

全文

我确信Joomla本身应该为introtext声明这样一个类,或者至少应该有一个可配置的选项

我不想要的:

  • Joomla 1.x或Joomla 1.5解决方案
  • 手动方式,直到没有 扩展基础解决方案(更奇怪!)

回答后更新

现在我遇到了
$this->item->introtext
$this->item->fulltext
$this->item->text
的问题

我希望
$this->item->introtext
只显示introtext,但它也包含阅读更多内容之后的内容

我应该使用什么属性只包含阅读更多内容之前的内容,而不包括其他内容

我不希望
$this->item->introtext
内容受文章选项中的
Show Intro Text
参数的影响。预计只有
$this->item->text
关心它。我说得对吗

注意:
$this->item->fulltext
按预期工作,仅在阅读更多内容后输出内容


如果禁用文章选项中的
Show Intro Text
参数,请在阅读更多内容后返回所有3个变量的文本。这确实应该被视为一个bug


根据文章参数:
Show intro text

您需要做的就是添加一个模板覆盖。您需要制作此文件的副本:

/JOOMLA INSTALL/components/com_content/views/article/tmpl/default.php
对代码进行所需的任何更改,然后将其上载到此处:

/JOOMLA INSTALL/templates/flexibility/html/com_content/article/default.php

就这么简单。

在Joomla 3.3.0中,它就像您所期望的那样工作:

<div id="introtext"><?php echo$this->item->introtext; ?></div>
<div id="fulltext"><?php echo $this->item->fulltext; ?></div>


(在templates/your_template\u name/html/com\u content/article/default.php中)

完美!我真的很感激你的回答。我认为我只需要更改核心组件。你给我展示了标准的方法:)我已经根据你有用的答案更新了我的问题。再次感谢。作为提示,如果您想在全文中使用内容插件:;echo$ftext