Thay đổi icon feed rss mặc định trong drupal

Bạn đã chán với cái icon feed rss mặc định của drupal ở file page.tpl.php
<?php print $feed_icons ?>

Có hai cách để bạn có thể thay đổi nó:

Cách thứ nhất

Bạn vào thư mục misc bên trong thư mục chứa drupal và ghi đè file mới lên file feed.png.
Cách này nhanh gọn,nhưng buộc bản phải có file icon là png. Và nó không phù hợp nếu site của bọn có nhiều theme và ở mỗi theme có một icon feed khác nhau.

Cách thứ 2

Cách thứ 2 này tuy phức tạp hơn. Nhưng sẽ giải quyết được những vẫn đề trên của cách 1
Đầu tiên bạn copy hình ảnh icon feed của bạn vào trong thư mục: '/sites/all/themes/yourthemename/images/feed.png'

Bước thứ 2 bạn tạo 1 file có tên là template.php trong thư mục '/sites/all/themes/yourthemename/'
Trong file template.php bạn coppy nội dung sau
Nếu bạn đang dùng Drupal 5:

<?php
function yourthemename_feed_icon($url) {
  if (
$image theme('image''/sites/all/themes/yourthemename/images/feed.png't('Syndicate content'), t('Syndicate content'))) {
    return 
'<a href="'check_url($url) .'" class="feed-icon">'$image'</a>';
  }
}
?>

Nếu bạn đang dùng Drupal 6

<?php
function yourthemename_feed_icon($url$title) {
  if (
$image theme('image''/sites/all/themes/yourthemename/images/feed.png't('Syndicate content'), $title)) {
    return 
'<a href="'check_url($url) .'" class="feed-icon">'$image .'</a>';
  }
}
?>

Sau đó lưu lại. Rồi chiêm ngưỡng kết quả.Hehe!!!

Comments

Thể hiện 2 ngôn ngữ

Em đang làm trang thông tin về kinh doanh.Cho e hỏi làm sao khi user viếng thăm Website của mình thì đầu tiên nó sẽ hiển thị 2 loại ngôn ngữ Việt và Anh và mình muốn xem bằng ngôn ngữ nào thì chọn ngôn ngữ đó

Bạn đã gửi phản hồi không phù

Bạn đã gửi phản hồi không phù hợp với chủ đề của post này. Vui lòng xem cách gửi câu hỏi ở site này.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <sup> <br> <p> <h3>
  • Lines and paragraphs break automatically.
  • Link to content with [[some text]], where "some text" is the title of existing content or the title of a new piece of content to create. You can also link text to a different title by using [[link to this title|show this text]]. Link to outside URLs with [[http://www.example.com|some text]], or even [[http://www.example.com]].
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.