I am very much new to Drupal but am loving it to start with.
I got struck at a point with respect to theaming.
I have a region called 'footer-teaser' just above footer. Its width is 800px. its been split into 3 equal size columns. Each column has the following.
- Image of size 120x120
- Some teaser text
- Link to 'read more'
The design requirement is all the above should be editable by the admin from the admin interface. If its static i would have hardcoded this but since the requirement is dynamic, i am not aware of how to achieve this. I have customised page.tpl for other sections of the page except this.
I am sure someone else would have faced this issue before and was wondering if anyone can开发者_StackOverflow中文版 direct me in the right direction? Even better if an example is provided.
Cheers RD
When you say you have a "region" called footer-teaser are you talking about a region in Drupal theming terms, if so skip to part two of this answer.
Part 1, set up a region to put content in.
in your theme.info file you can define regions, these are shown as places to but blocks on the block admin tool. Change your theme.info file to include something like
regions[footerteaser] = Footer Teaser
you will also need to print $footerteaser
in the appropriate place in your .tpl file.
Test this works with another existing block before moving to part two.
Part 2, populate the region.
There are many ways you can generate the code to populate this region. I believe the simplest would be to create editable blocks as in the block example module.
If you want static content that is editable from an admin interface, so you don't need to make a list of top nodes and that sort. You can create a block from the block interface, and put any html in it.
If you need to make lists of content etc, you can use the views module to create such blocks.
Else you will have to use the custom block approach that Jeremy suggests.
精彩评论