2

I'm creating custom templates for my Drupal 7 site. There is a custom content type called flowers.

  1. Which template file (.tpl.php) should I put under templates directory of my theme's folder for displaying a single flower-type node?

  2. Can I use the Views module to create different views (i.e displaying picture of a flower in a view & displaying species of the flower in another view) for displaying only a single flower-type node? So far I can create pages that displays list of flower-type nodes. I want to display just a single (perhaps providing it's node-id) flower-type node. How do I do that?

    2.1. For displaying different types of views to display a single flower-type node, which template files (.tpl.php) should I edit?

Thanks in advance for caring :)

4

Create node--flowers.tpl.php, put the default code from modules/node/node.tpl.php, and edit it.

  • Thanks @ram4nd. Would you please take some time and answer the 2nd problem - creating Views using Views module to display just one flower? Thanks – Shafiul Oct 15 '11 at 10:13
  • You can do this under pager settings. Instead of pager select display specific number of items. And you can configure the number of displayed items and offset. – ram4nd Oct 16 '11 at 9:38
  • Your answer is incomplete, so I answered it after creating a fully detailed tutorial on my blog. Thanks & +1 for helping – Shafiul Nov 4 '11 at 4:35
-1

To display a single node of any content-type, see my detailed tutorial published on my blog: http://wp.me/pA443-6X.

  • 1
    You should report in your answer the main point you wrote in your blog post. Link rotten happens, and this answer would not be anymore an answer, but something that contains a link to a page nobody can reach. – kiamlaluno Nov 4 '11 at 10:05
  • You can improve upon my answer. But taking my answer putting it down and then selecting your answer as the accepted answer is just immoral. – ram4nd Jan 18 '18 at 12:11

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.