简体   繁体   English

如何在Joomla 3中覆盖类别博客?

[英]How to do a category blog override in Joomla 3?

What I am wanting to do is edit my category blog layout so that: 我想要做的是编辑类别博客布局,以便:

  1. The description to be limited to x amount of characters (on the fly without having to insert a read more break in the article) 该说明仅限于x个字符(即时运行,而无需在文章中插入更多阅读内容)
  2. Remove all formatting from the article text. 从文章文本中删除所有格式。

Then when the full article is opened all the full text and formatting is present. 然后,当打开全文时,将显示所有全文和格式。

Could someone please tell me which files I need to modify/duplicate please, would really appreciate it explained as simply as possible as this is the first time I have dove into overrides :) 有人能告诉我我需要修改/复制哪些文件吗,真的很感激它解释得尽可能简单,因为这是我第一次研究覆盖:)

I have created an overwrite of the file blog_item.php using the built in function within my template section within joomla but the contents of this file are: 我在joomla的模板部分中使用内置函数创建了文件blog_item.php的覆盖,但该文件的内容为:

   <?php
   /**
   * @package   yoo_master2
   * @author    YOOtheme http://www.yootheme.com
   * @copyright Copyright (C) YOOtheme GmbH
   * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
   */

   // include config and layout
   $base = dirname(dirname(dirname(__FILE__)));
   include($base.'/config.php');
   include($warp['path']->path('layouts:'.preg_replace('/'.preg_quote($base, '/').'/', '', __FILE__, 1)));

is it just pointing the script to the original joomla file for blog_item.php? 它只是将脚本指向blog_item.php的原始joomla文件吗?

Thanks Luke 谢谢卢克

In the administrator, 在管理员中,

  1. go to Template Manager, Templates and click on the name of the template you are using. 转到模板管理器,模板,然后单击您正在使用的模板的名称。
  2. Go to the Create Overrides tab. 转到“创建替代”选项卡。
  3. Under components, select com_content> category 在组件下,选择com_content>类别
  4. Under layouts, select content 在布局下,选择内容
  5. Go to the editor tab. 转到编辑器标签。
  6. Under html, com_content select blog_item.php 在html下,com_content选择blog_item.php
  7. Around line 47 you will see <?php echo $this->item->introtext; ?> 在第47行附近,您将看到<?php echo $this->item->introtext; ?> <?php echo $this->item->introtext; ?>
  8. Wrap that in the string truncation method. 将其包装在字符串截断方法中。

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

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