Joomla教程:為“read more”鏈接添加對應的文章標題 

 

 

http://www.inspirr.com 
 

 


 

 

 

樣為“read more”鏈接添加其對應的文章標題?

使用自定義模板覆蓋的方式:

    如果模板路徑中不存在名為“html”的文件夾,請創建新文件夾,命名為“html”。 在“html”文件夾中創建名為“com_content”的文件夾 在“com_content”文件夾中創建三個文件夾,分別命名為“category”,“frontpage”,“section”。

返回joomla根目錄,找到如下文件:

(joomla根路徑)/components/com_content/views/category/tmpl/blog_item.php (joomla根路徑)/components/com_content/views/frontpage/tmpl/default_item.php (joomla根路徑)/components/com_content/views/section/tmpl/blog_item.php

將上述文件復制并粘貼到之前新創建的模板文件夾中,最終文件路徑為:

(自定義模板路徑)/html/com_content/category/blog_item.php (自定義模板路徑)/html/com_content/frontpage/default_item.php (自定義模板路徑)/html/com_content/section/blog_item.php

打開這些文件。在這些文件接近底部的地方可以找到如下代碼:

<a href="/<?php echo $this->item->readmore_link; ?>"COLOR: #000000; FONT-WEIGHT: bold"><?php echo $this->item->params->get('pageclass_sfx'); ?>">
<?php if ($this->item->readmore_register) :
echo JText::_('Register to read more...');
elseif ($readmore = $this->item->params->get('readmore')) :
echo $readmore;
else :
echo JText::sprintf('Read more...');
endif; ?></a>

將其中:

echo JText::sprintf('Read more...');

修改為:

echo JText::sprintf('Read more', $this->item->title);

現在的“Read more”鏈接看上去應該是這樣了: “Read more:文章標題”

 

 

   

 

  Tag: 設計公司 | 網頁設計公司 | 廣告公司 | 網站設計 | 平面設計 | 互動媒體 | 網頁設計 | Web design | Website design | design house | 媒體公司 | Iphone app | 程式設計 | Flash 網頁 | Flash game | 動畫設計 | 後期製作 | 網上商店 | 網上宣傳 | 網頁服務 |

arrow
arrow
    創作者介紹
    創作者 inspirr 的頭像
    inspirr

    inspirr

    inspirr 發表在 痞客邦 留言(0) 人氣()