Hi all,
1. I am using Drupal 6.5
2. I have searched Drupal website and could not find a solution.
3. I would like to use only core modules. (The forums has suggestions for using contributed modules.)
4. I am looking for PHP snippet for this issue
5. I am a beginner in PHP. I am not only a Drupal Dummy but also a PHP dummy.
I have several categories (terms). Each term has got many articles. All articles are story types - NO custom content type. My main categories are Animals, Birds, Flowers and Fruits and they already contain dozens of articles and are updated regularly.
I would like to have a custom front page (home page). This custom home page will show latest 3 nodes from each of my main 4 categories. I have created a page-front.tpl.php using suggestion in the template.php. I would like to know what php code should I add to page-front.tpl.php to display the nodes from main categories. For example,
Animals (category) - Latest 3 nodes with titles and teasers
- Latest node 1 with title and teaser
- Latest node 2 with title and teaser
- Latest node 3 with title and teaser
Birds (category) - As above
Flowers (category) - As above
Fruits (category) - As above
I do NOT want to use core or non-core modules like Views, node queues, etc. I am trying to learn how to add raw php code to the page.tpl.php. In short I am looking to do the following task through php snippet:
For the term Animals, print the title and teaser of 3 latest nodes with Read More links.
For the term Birds, print the title and teaser of 3 latest nodes with Read More links.
For the term Flowers, print the title and teaser of 3 latest nodes with Read More links.
For the term Fruits, print the title and teaser of 3 latest nodes with Read More links.
Thanks.
Comments
You are really going about
You are really going about it the hard way, using modules makes the site more portable and easier to upgrade. Knowing PHP or not the views module plus maybe panels is a reasonable approach.
I agree
I agree that views plus panels is an easy and off-the-shelf solution and I can quickly setup a website. I have already learnt how to do it. But I am looking to solve it through hard code. I would like to learn the process of customization. Thanks.
Partly Solved
After some research I found some code and I modified it. The result is: I get a list of titles of the nodes. Can someone please tell me how to get the teasers and submitted by for each node? Thanks.