2014-05-01 55 views

回答

0

將此代碼放置在主題的template.php文件中(用YourThemeName,YourContentTypeNewReadMoreText替換爲您的主題名稱和所需的更多文本),覆蓋節點輸出。

Source

<?php 
// Preprocess variables for node.tpl.php. 
function YourThemeName_preprocess_node(&$variables) { 
    // Let's get that read more link out of the generated links variable! 
    unset($variables['content']['links']['node']['#links']['node-readmore']); 

    // Now let's put it back as it's own variable! So it's actually versatile! 
    if ($variables['type'] == 'YourContentType') { 
    $variables['newreadmore'] = t('<span class="YourContentTypereadmore"> <a href="!title">NewReadMoreText</a> </span>', 
     array('!title' => $variables['node_url'],) 
    ); 
    } else { 
     $variables['newreadmore'] = t('<span class="newreadmore"> <a href="!title">Read More </a> </span>', 
     array('!title' => $variables['node_url'],) 
    ); 
    } 

    $variables['title_attributes_array']['class'][] = 'node-title'; 
} 
?> 
+1

爲什麼downvote? –

+0

這是基本的修復。我所做的只是去我的WWW目錄和grep -r「更多」,對我來說是位於模塊/節點/ node.module 然後我做了該文件的副本,並在那裏改變了它的「Load更多的」我的需求: 如果($ view_mode == '傳情'){$ = node_title_stripped用strip_tags($節點 - >標題); $鏈接[ '節點readmore'] =陣列( '標題'=> T( '加載更多的約@title',陣列( '@標題'=> $ node_title_stripped )), 'HREF'=> '節點/'。$節點 - > NID, 'HTML'=> TRUE, '屬性'=>數組( '相對'=> '標籤', '標題'=> $ node_title_stripped), ); } – seizethecarp