如何在Drupal7中使用Ajax寻呼机
我想在我的区块中使用ajax_pager。 我已经安装了库API和Ajax寻呼机API(如AP API页面所述)。但它仍然不起作用。 当我使用“寻呼机”而不是“ajax_寻呼机”时,它就工作了。 我做错了什么如何在Drupal7中使用Ajax寻呼机,ajax,drupal-7,block,pager,Ajax,Drupal 7,Block,Pager,我想在我的区块中使用ajax_pager。 我已经安装了库API和Ajax寻呼机API(如AP API页面所述)。但它仍然不起作用。 当我使用“寻呼机”而不是“ajax_寻呼机”时,它就工作了。 我做错了什么 <?php function latest_news_block_info() { $blocks['latest_news_block'] = array( // info: The name of the block. 'info' => t
<?php
function latest_news_block_info() {
$blocks['latest_news_block'] = array(
// info: The name of the block.
'info' => t('Latest News'),
);
return $blocks;
}
function latest_news_block_view($delta = '') {
// The $delta parameter tells us which block is being requested.
switch ($delta) {
case 'latest_news_block':
// Create your block content here
$block['subject'] = t('Last news');
$query = new EntityFieldQuery();
//change news by the name of your content type
$entities = $query->entityCondition('entity_type', 'node')
->pager(5, 0)
->entityCondition('bundle', 'news')
->propertyOrderBy("created", "DESC")
->execute();
$content = "";
foreach($entities['node'] as $obj) {
$node = node_load($obj->nid);
$content .= "<img src='" .file_create_url($node->field_image['und'][0]['uri']) . "' width='200px' height='200px'>" . l($node->title, "node/" . $node->nid) . truncate_utf8($node->body['und'][0]['value'], 200, true, true) . '<br><hr>';
$block['content'] = $content;
}
break;
}
$pager = theme('ajax_pager', array('parameters' => array('selector' => 'block-system-main')));
$block['content'] .= $pager;
return $block;
}
怎么不工作?寻呼机不显示