I have to make a custom main page, that looks like this:

logo
--------------------------
main news
--------------------------
last sport news
--------------------------
last movie news
--------------------------
footer

I need 1 main news on the top of the page and last news from other topics, but drupal prints all news one by one. How to change this?

Comments

micha_1977’s picture

is the magic here =)

well its the most simple solution for this i think, promote all news to the frontpage and the main news becomes a sticky one

micha

init’s picture

But i want also static structure, where last news from all topics will be on it's place. And this structure must be only for main page. Just making news sticky is not a solution.

micha_1977’s picture

i would look into the front page module

dan90@drupal.org’s picture

I'm having to set up a similar thing, ('cept I'm looking at having most recent events and stories on the neat static page, as opposed to two different types of stories)

I'm trying to get the block code from http://drupal.org/node/4587 to look presentable an a front page as oppased to a block. no luck yet at even getting the code to work under 4.5.2, and when it does, i think it will be just the titles, not the teasers and so on...

init’s picture

Hm, i think i found a solution. I modified template.php (i use phptemplate engine), made some new variables - last_main_news, last_sport_news... and with is_front variable in page.tpl.php i print these news.

dan90@drupal.org’s picture

simultaneous posting.

Where did you define last_sport_news and last_main_news? in your template.php?

init’s picture

I've added to template.php something like this:

...
$result = db_query("SELECT...
$node_last_main_news = db_fetch_object($result);
$result = db_query("SELECT...
$node_last_sport_news = db_fetch_object($result);
...
$vars['last_main_news'] = theme('node',$node_last_main_news);
$vars['last_sport_news'] = theme('node',$node_last_sport_news);
....
adrian’s picture

You can read about it in the handbook.
--
The future is so Bryght, I have to wear shades.

dan90@drupal.org’s picture

Thanks for your help, dudes, you've made my development process that leetle bit easier

Jaza’s picture

Sounds like what you're trying to do is exactly the setup I have on the front page of my site. I did this by hacking apart the node_page_default() function in node.module - I worked out that this is the function responsible for actually printing out the front page (assuming that your front page is /node). So if you want to change your front page, as I have (and as you want to), so that it prints out a few of the latest items grouped into taxonomy terms (instead of just the default chronological node listing), then this is the place to do it.

Jeremy Epstein - GreenAsh

Jeremy Epstein - GreenAsh

init’s picture

yes, I was need exactly what you have, but i think changing theme is better than changin module:)