How to add news in block?

Spillerspoiler - June 29, 2008 - 20:06

Hi! I want to add any content type (page for example) to block but I don't know how.
I just want to see news in the left or right sides of my website, they must look like:

text text text text text
text text text text text
text text text text text
text text text text text
text text
| read more (link)

text text text text text
text text text text text
text text text text text
text text text text text
text text
| read more (link)

text text text text text
text text text text text
text text text text text
text text text text text
text text
| read more (link)

etc.

Help me please)

adding blocks

decibel.places - June 29, 2008 - 20:15

If you are placing RSS feeds as "news" which you added in aggregator they are automatically created as blocks which you can position

Otherwise you can create a custom block with any code you require embedded

Either way look at http:// yoursiteurl/admin/build/block

and here is a Book Page about Drupal blocks

http://drupal.org/handbook/modules/block

~are you netsperienced? http://netsperience.org

Views module

Keyz - June 29, 2008 - 20:58

What you need is the Views module. Here's a lesson I wrote that is somewhat similar to what you're trying to do: http://drupal.org/node/168752#comment-263585 (this is to make a block with one "random" piece of content, however you can easily adapt it to have however many items you want, and listed in order by most recent date by adjusting a few things). As an example, see this page of mine, which uses Views to make the blocks on the home page and side bar (and just about everything else for that matter). Views takes a bit of time to learn, but is completely worth it and will open up countless new possibilities for you with your Drupal site. I suggest you make a custom content type to serve as your "news". If you haven't already, I also suggest you install CCK module, which is another must-have module. You could then add custom fields to your "news" content type that you might want just for news, such as an imagefield that uses Imagecache module to generate custom image sizes between the preview image and the actual news page, as seen on the site I mentioned above).

Good luck!

- David

Tell me something

yoandri - April 30, 2009 - 02:01

I saw that page of yours, and I have something to ask you. In the news, How did you insert the images inside the text ???

If you mean the blocks on the

Keyz - April 30, 2009 - 07:01

If you mean the blocks on the home page, then... that's a View in which the fields I wanted to include are shown (title, post date, imagefield with thumbnail imagecache preset, custom textfield with teaser text, followed with a read-more link). My CCK and Views lesson may help.

If you mean the images inside the content when you go to one of the pages itself... the first image is the imagefield with a larger Imagecache preset on it (in this content type, all nodes are required to have 1 primary imagefield). After that the images are no longer imagefields, but instead from Image module + Image Assist. I don't actually care for either of those two modules very much, but they do the job. There are other alternatives as well, none of them perfect either, but depends on your needs... e.g. IMCE, Image Browser, Image Picker, etc. It's still brand new and under development, but in the future I hope to switch to Filefield Sources as well as the upcoming Media module.

 
 

Drupal is a registered trademark of Dries Buytaert.