is there any module or instruction to help me build a News Item section for my Drupal 6.2? I am integrating from Joomla to Drupal and I had a news section in my Joomla I would like to be able to create the same section in my new Drupal as well.

A News Item will have title, date, source, body, attachments, and comment features, and A block which can view the title for latest News Items.

Any help is highly appreciated.

Thanks

Comments

amnion’s picture

Just create a new node type and call it "news". If you don't want users to be able to post news items, configure the permissions accordingly. You'll be able to use the views module to configure blocks like you want. You can create a new page with blocks of content even to display your news items however you want, and give the page it's own menu item. This is how I do my news stuff. I hope this helps.

-Anti-’s picture

> You can create a new page with blocks of content even to display your news items
> however you want, and give the page it's own menu item.

At somepoint I'll also need to get around to learning how to make a 'news section'.

Can you elaborate on what you mean by 'create a new page with blocks of content'
and 'give the page its own menu'?

Are you talking about themeing a layout which only displays for the news section?
Or are you talkng about some settings/modules within Drupal itself?

If themeing a particular layout for a specific content-type, can you give any
indication on how to try to do this?

Thanks.

alan d.’s picture

1) Create a new content type: "news"

admin/content/types

2) Install views

3) Create a new view

admin/build/views

4) Use a page view, and set the url and menu item

5) Filter on "node type = news", "status = published"

6) Once your happy with the results, start thinking about more fields

a) Install CCK, imagefield, imagecache

b) Define them

admin/content/types/news

7) Get the theming done. This is usually the hard bit.

Hope this helps to guide you in the right direction. Only step 7 requires coding/theming, the rest is point and click.

Cheers


Alan Davison
www.caignwebs.com.au

Alan Davison
amnion’s picture

you can have your page view point to a certain URL also, which might be this section you're thinking about (once you get this page created, you just add a new menu item that links to this page--Admin, Site Building, Menus). You can also configure all your news-related blocks (with views as well) to only appear on this page, or whatever page you like.

I have a similar thing set up on my site's front page, where I have three blocks in the content view (the top one is for my image slideshow, and stays constant; the second block displays our daily workout; the third block dispays the latest headlines). The second block is set to display only one node (the latest one of the day), so this one automatically links to my page view with a "more" link at the bottom. For an example you can see: www.fatalfitness.com.

-Anti-’s picture

Thank you both for taking the time to reply.
That's a big help.

koyauni, sorry for hijacking your thread!
Hopefully you found these answers helpful too.

Cheers.

droshani’s picture

I will give it go and see if I can do this.

One thing I realise Drupal structure do not allow you to put the Original Author name for a posted record. Let say I am the one who creating the post for an Article on Relativity, but the actual writer of the article is Einstein from 1922. If I try to put the author's name it will say the user is not registered.
Any suggestion how I fix this.

-Anti-’s picture

> One thing I realise Drupal structure do not allow you to put
> the Original Author name for a posted record.

That field is specifically so you know which USER 'posted the
content'; that is what is meant by 'author'. Note that normal
users can't edit this field - you are only able to edit the author
because you're admin.

Having this field is very necessary for administration purposes,
but it can also be used to display content. For instance, using
the Views module to display all content that has been posted
by a certain user. Or it can simply used just so each node can
link to the profiles, so readers can contact the 'authors'.

If you want to add fields like 'original author', you need to create
a 'content type' using the CCK module. It will allow you to add all
sorts of new fields to the 'content type' submit forms.

droshani’s picture

I would like to get a News Item Feature
such as this
http://news.bbc.co.uk/1/hi/also_in_the_news/default.stm

an small image with couple lines and then by click user will go to main news item page

look at my project www.kurdishacademy.org which I converted from Joomla to Drupal. Well I just transferred all data from Joomla to Drupal manually.

I will follow the instruction see how it goes. I have to create a test website first

afandyag’s picture

I'am new to drupal and your reply is very helpfull. Thx

droshani’s picture

I will do this and I hope I will be able to do it.

amnion’s picture

It sounds like all you need to do is show your "also in the news" sections as a teaser with teaser images. This is possible with Drupal, but I have not been able to get teaser images to work with my site yet.

dam’s picture

you synthesis is great! very clear. I made the news view very quickly.

http://www.squadrainformatica.com/smak/news

Now the answer is.. how to syndicate with RSS the content of the view? I need at least a starting point.

Thanks in advance
Cheers

droshani’s picture

Can you please write you instruction step by step how you did it, I could not get it work?

dam’s picture

I think that Alan's suggestions are much better than I could do for you.

ps. I changed the url previously postes. now it's http://www.squadrainformatica.com/smak/home/view_news . If you need support doing something like that just ask

cheers
Dam

droshani’s picture

I have done ( .... )

1) Create a new content type: "news"

admin/content types/ Add new type "News" (I have done this )

2) Install views (I have already done this)

3) Create a new view

admin/build/views (I created view for News)

4) Use a page view, and set the url and menu item (I have no idea how I do this :( )

5) Filter on "node type = news", "status = published" (U have created The filter for News Type and Published)

6) Once your happy with the results, start thinking about more fields (I have already added the files to my Content type)

a) Install CCK, imagefield, imagecache (ImageField, ImageCache are not supported for D6.2, )

b) Define them

admin/content types/news

7) Get the theming done. This is usually the hard bit. (Would you please elaborate on this? )

Hope this helps to guide you in the right direction. Only step 7 requires coding/theming, the rest is point and click.

alan d.’s picture

Step 4 - Page view : I just provided the block features in the export below

In Drupal 5, there is a section called Block and a section called Page, the second and third fieldsets from memory.

To enable the page, open up the page section

1) Check provide page view

2) Give this a URL, "news"

3) Select teaser list. (Full nodes and teaser lists avoid the complications of setting up the fields required by table and list views)

4) Give it a menu item just like a normal page (if needed)

To link the block to the page, open the Block section and check "Provide more link"

Theming should be covered in the docs and it is an open ended topic!

See

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

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

plus go a general search when you hit a particular problem. Try starting a new thread to get help on any particular theming topic.

PS: While everything here is for Drupal 5 to date, if you are using Drupal 6, install the Devel module and it will give you a theme developer tool that really helps theming. Plus a flush cache link, vital for Drupal 6 theming!


Alan Davison
www.caignwebs.com.au

Alan Davison
alan d.’s picture

Hoping that the hard bit is the views.

AFTER creating a new content type you can create a view from this export. (From D5 install)

Firstly, create the new content type call "News item", with a machine name "news" <- do not change the machine name.

Install Views and Views UI if required. (UI is the actual admin interface!)

Import the following view code. This will be a tab on the views admin page.

  $view = new stdClass();
  $view->name = 'recent_news';
  $view->description = 'List of recent news items';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = FALSE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '3';
  $view->page_footer = '';
  $view->page_footer_format = '3';
  $view->page_empty = 'There are no current news items.';
  $view->page_empty_format = '3';
  $view->page_type = 'node';
  $view->url = '';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->block = TRUE;
  $view->block_title = 'News Flash';
  $view->block_header = '';
  $view->block_header_format = '3';
  $view->block_footer = '';
  $view->block_footer_format = '3';
  $view->block_empty = '';
  $view->block_empty_format = '3';
  $view->block_type = 'list';
  $view->nodes_per_block = '5';
  $view->block_more = FALSE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'node',
      'field' => 'body',
      'label' => '',
      'handler' => 'views_handler_field_teaser',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'news',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node);
  $views[$view->name] = $view;

Scroll down to the filters section and make sure that the news item is selected in the node content type. This is just above the "exposed filter" stuff. (Imports do not work if the names do not match, thus this check.)

Save again. (I find that it requires a second save to work properly anyway)

Go to your blocks admin page and enable the block call "recent_news"

This block will not show until there is something to display, so go to create content and create a new, published, news item

The block should appear after you save the page.


Alan Davison
www.caignwebs.com.au

Alan Davison
droshani’s picture

I use D6.2 and I do not see the filter section you mention here.
In import page is just
Title
Text to import
and Import button at the bottom of the page

alan d.’s picture

Since views and cck were alpha and beta when I last checked, we are still using Drupal 5 for sites that need this functionality.

I haven't had any experience using these in Drupal 6.

Sorry


Alan Davison
www.caignwebs.com.au

Alan Davison
dam’s picture

I don't have the time right now to read carefully all the thread. But I put 2 screenshot of my view panel (6.2) here
http://www.venturin.net/dam/pics/view1.png
http://www.venturin.net/dam/pics/view2.png

Hope they will be helpful

Cheers
Dam

droshani’s picture

Well this was the best way to see actually what is need, Thank, as you can see I am not able to define the Path for the page. I tried different way but no successes. What should put as path for the page?

http://98.130.180.92/view_news_srd.png

I did add some extra filed to my News page but I can not see them in view set-up. How should make sure they are displayed on the new page? It is URL filed for the news and News source fields.

dam’s picture

http://www.venturin.net/dam/pics/view3.png

look at the red mark. I have two layers "default" (it's created by default when you add a view) and page (I added it clicking on the button below)

droshani’s picture

There is something wrong with the image link,

dam’s picture

fixed

droshani’s picture

As you see I did the same but I renamed the Default page to Page
http://98.130.180.92/view_news_srd.png

So you are saying I should just keep a default view and create a page as well?

and I found this
http://www.youtube.com/watch?v=eV__oOckAPM

dam’s picture

you can keep the default and then you add a "page layer", just as in the picture. It works for me

droshani’s picture

I have created oe but the title in Bloc is not linked tp the item page
http://98.130.180.92/

Have I missed anything along the way?

alan d.’s picture

As I said, I have no experience in D6 views, but look into the Block section and see if there is a option "More link". Simply check this

I think this only shows after you have more news items than the limit set in the block section.


Alan Davison
www.caignwebs.com.au

Alan Davison