A collaborative blog style website, gothamist.com (http://www.gothamist.com/) has their main page basically like a standard drupal page with the most recent 15 or so stories posted in the center column but then at the very end of the center column there is a list of headlines of recent stories. I'd love to have the most recent 15 stories in my center column and then at the end have a list of the NEXT 10-20 most recent stories posted but only listing the headlines and links to the nodes. Any ideas how to do this?

Comments

venkat-rk’s picture

You can try the php code snippets (http://drupal.org/node/20630) for the stories and the headlines module at www.civicspacelabs.org

If this works, please give feedback so that it will be useful to others.

Ramdak

Dublin Drupaller’s picture

Hi Sg...

Might be better to go the Sliced Bread php snippets handbook pages. That thread the other poster linked to is a bit unweidly and difficult to follow.

These snippets are something you simply can copy n paste into a normal drupal page (with the PHP Code Filter enabled) and some tips on how to put in more than one snippet...

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sgwealti’s picture

Thanks! That's exactly the type of solution I was looking for to solve this problem and several others. However, I do have one question. If I'm creating a "page" with a php snippet to get the content, and I promote the page with the php code to the front page, won't the content it generates move around on the page as it gets "moved down" the page as new content is posted? I guess I don't really see how creating a page with php code snippets will make it always stay in the same place on the front page unless it's made sticky, but then it will always appear at the top.

Dublin Drupaller’s picture

Hi Sgwealti..

I'm not sure what you mean.

What are you using for your front page?

is you use the node or page you created with your php snippets as your front page (i.e. go to ADMIN-->> SETTINGS and set your default front page to point to that php snippet node) nothing will move anywhere.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sgwealti’s picture

Right now my default front page is "node" which gives me a front page that displays the most recent 15 nodes with headlines and teasers, etc...

Are you saying that I should change that setting and make the default front page point to the page I create with the php code? If so, what code do I need to put in the php snippets page to make sure that the "node" page is displayed before my headlines?

Dublin Drupaller’s picture

Hi Sgwealti...

...here's some tips..

to change the default front page

  1. go to ADMINISTER -->> SETTINGS
  2. scroll down until you get to the DEFAULT FRONT PAGE field
  3. change that field to be you're new front page

That means that when you click on the home link or go into your site, that node you reference in the DEFAULT FRONT PAGE field will be your default front page...or the first node you will see...

I'd love to have the most recent 15 stories in my center column and then at the end have a list of the NEXT 10-20 most recent stories posted but only listing the headlines and links to the nodes.

There are probably a few modules that can do that for you,a s the other posters have mentioned...although I suggest you check out the php snippets page in the handbook.

Let's say for example you wanted to list the 10 most recent weblog titles and teasers followed by the next 10 upcoming events...you could use the snippet that list the 10 most recent weblog titles and teasers and follow that with the snippet that lists the 10 next upcoming events...

there is also a tip here that explains how to tweak the code snippet(s) to list items from any node type...

Hope that makes sense.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sgwealti’s picture

Thanks for all your help. I got it working now. The page I created is at http://www.dane101.com/main

The only problem is that it has that view, trackback, and edit tab thing at the top and I need to get rid of that so that it looks like the normal main page (which can be seen at http://www.dane101.com) . Any ideas on how to get rid of that and suppress the display of the page title so that "main" does not appear at the top of the page?

Dublin Drupaller’s picture

Try one of the following. there are more ways of doing what you want, so these are just simple easy-to-implement suggestions..

1. I don't use the trackbacks thing, so I'm not sure if you can suppress it via the ADMIN -->> SETTINGS page. if you can't you could us the "is_front" variable to hide it if you're using a phptemplate based theme...there are a few tips in the handbook page on how to do that.

2. use the front_page.module ...http://drupal.org/project/front and paste your php code snippet into that. (installation instructions are provided with that)

Hope that helps

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

somes’s picture

Also have a look at the image node

it may be starting point for some of the image implementation
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/node_image/

As for postioning content use div tags and declared them in the CSS. These can be appended to the $output variable and passed to you theme.

does any one know if you can mix html and php... it also seems apparent the drupal can only handle one ..? php .. call

placing two side by side generates an error. What Im trying to say is that is there another way of using php and html together other than parsing it all in a large $output variable

Let us know how you get on

I need to tackle something like that in a week or so, I would be interested to see what you come up with

sgwealti’s picture

Ok, I'm 95% of the way there. I created my page with php snippets that display the stuff I want displayed. I used the front page module to make it the front page which got rid of the trackback/edit tabs at the top but now I need to add the

1 2 3 4 5 6 7 8 9 ... next page last page

links at the bottom and I can't figure out how to generate this part but I bet it can be done with another php snippet. Any php-people want to help me out.

Thanks.

-Shane

somes’s picture

Just had a look at the site.... nice.... what did to end up going when adding images to content... did u have any problems