douhui8025 2015-08-27 22:52
浏览 31

如何在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)
  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:

   <?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?

Thanks Luke

  • 写回答

1条回答 默认 最新

  • douzhang6646 2015-08-28 23:20
    关注

    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
    4. Under layouts, select content
    5. Go to the editor tab.
    6. Under html, com_content select blog_item.php
    7. Around line 47 you will see <?php echo $this->item->introtext; ?>
    8. Wrap that in the string truncation method.
    评论

报告相同问题?

悬赏问题

  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法