1

I would like to know the appropriate way to listing the contents in a single page of type "news". Let me clear it once again, I have a "news" type custom content type.

Now i want to list all the pages of type "news" in a separate(say about us) page and styling them. Prior to this I have created a template file in my custom theme's template directory named as "node-news.tpl.php". Thanks In Advance.

1

Yes, you can use views module to generate a page to display all node of news content type.

  • Install a views module
  • Go to administrator -> structure -> views
  • Add new view
  • Add filter content type as "news"
  • Add fields to views.
  • Yes that is quite easy, but i need to list all the pages without using view module and also database query .Can it be possible using some code in template.php or anywhere else?? – Satyabrata sahoo Apr 11 '13 at 5:54
  • You need to create a custom module and can write the custom query in the module. – Jayendra Kainthola Apr 11 '13 at 6:51
1

The views module do that. There's many articles about this question. Take a look on existing answers

0

Yes You can do it in your template file . Drupal suggest names for the custom content type template files.

 and it is page--node--your_content_type.tpl.php .

You can see your nodes of type (your_content_type) at here.

0

generate a View using the view module as mentioned by Satyabrata sahoo. generate a page view for your specific purpose that would be more appropriate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.