Joomla!-开源天空

2008-10-12
首页 专栏热点 Joomla! 应用 joomla 我的建站过程(三)-如何在复杂页面中直接调用模块 module


joomla 我的建站过程(三)-如何在复杂页面中直接调用模块 module

E-mail

在一个复杂页面中直接调用模块的我觉得非常需要,例如像组织首页或者二级栏目页的时候,就是涉及到一个页面中调用多个“豆腐块”,而只是参数变化,比如说不同分类的文章。写惯了程序,也没时间仔细去看joomla具体如何实现,是否有更简单的办法,学习了一下mod_latestnews模块的用法,我的实现方法如下:

<?php

require_once (JPATH_BASE .DS. 'modules' .DS. 'mod_latestnews' .DS. 'helper.php');
$params =new JParameter('');
$params->set('catid',28);
$params->set('count',3);
$list = modLatestNewsHelper::getList($params);
require(JModuleHelper::getLayoutPath('mod_latestnews'));

?>

这个是调用mod_latestnews模块,分类号28,显示3篇文章。具体使用的时候将参数改为合适的数值,看看mod_latestnews还有不少参数可调。

enjoy it now!



收藏此文章:
Digg! Reddit! Del.icio.us! JoomlaVote! Google! Live! Facebook! StumbleUpon! Yahoo! Free social bookmarking plugins and extensions for Joomla! websites!

发表您的文章评论

您的姓名 (昵称)
标题:
评分: 很差一般较好很好
评论:
验证码:
请输入验证码