Drupal默认情况下是类博客的风格。
两边是一个可定制的区块,上面是Header,下面是Footer以及划分开的Footer列。
最重要的部分是中间的主内容区域,以时间顺序显示所有发布的网站内容节点。
节点的显示模式可以定制比如teaser/default/customized。
但是整个内容区域确很难被定制成其他界面风格,比如按照文章类别或者关键字划分成若干列,若干行。
本文将介绍一个简单的方法来实现这一点。(old post forwarding here, written in english at that time)
Drupal has by default a bloggy feel, the latest items shown in date order, you could control
*) what kinds of the blocks to be displayed in content region from CMS, by block configuration
Home » Administration » Structure » Blocks
*) what kind of view mode used to display these items(teaser or full or customized) and which fields will be displayed, by going to
Home » Administration » Structure » Content types » Article
However, if you want to do more customization, for example, divide the content region into two columns,
we have to do some simple programming, this is the aim of this article.
of course, there are always more than 1 ways to do something in drupal, i will show you 2 here:
1. without Views
create a new page and make it the drupal default home page by going to site configuration
Under the administrator menu, select Administer -> Site configuration -> Site information.
Change Default home page to ‘home‘
2. with Views
you could use CCK/Views/Panels to do almost everything you want, please read the book: , but it takes time to learn these complicated stuff. I am showing you an easy way by just creating Views, hiding unneccessary content, writting few lines of codes.
*) Firstly install the Views module from the Drupal website
*) Create two views naming Mobile and Drupal, id would be mobile_view and drupal_view seperately
*) set the two Views css style as float left, width is as around 220px in your theme for example yeenav/themes/css/styles.css
*) hide the default system main content by changing your theming page template as below:
$uri = $_SERVER["REQUEST_URI"];
$querystrpos = strpos($uri,"?");
if($querystrpos) $uri = substr($uri, 0, $querystrpos);
if(in_array($uri, array($front_page, '/node', '/'))) {
unset($page['content']['system_main']);
}
print render($page['content']);
?>
Conclusion:
Though Drupal is not that flexible as cakephp/yii frameworks, but it does make a good effort balance on programming and integration/customization.
If you want to quickly build a website with powerful functionalities with as less programming as possible, then Drupal is defenitely worth to try.
by iefreer