• Home
  • About
  • Contact
  • Advertise

Devlounge

Design, Develop, and Grow

ateşli sevgilisi fantezisini yaşamak istediğini söyler porno ona arkadaşları varken onunla gizli saklı seks yapmak istediğini sikiş söyleyen kız hafta sonu için gelen arkadaşının görmediği bir sikiş açıdan sakso çekmeye başlayınca adamın yarağını bu altyazılı porno şekilde indiremez ve açık şekilde salonda sikişimeye sex izle başladıklarında misafir kızı da bu sekslerine rokettube konuk ederler seks yapacağını düşünmeyerek onun sex izle oyun oynadığını zanneder sabah olur ve herkes uyanır hd porno bu sırada yanında şişme mankenini de getiren sapık erotik hikayeler genç sınav haftası ders çalışan genç adam üvey annesinin sikiş eve gelmesiyle hayatının şokunu yaşar

  • Home
  • Code
  • Design
  • Design Focus
  • Interviews
  • Publishing
  • Strategy
  • Webapps
  • Extras

How to Make a Magazine-Style Homepage with Drupal, Pt 3

November 13, 2008 By Dustin Boston

In part two of this series, you got into CCK and views. This time around, you will be theming the views and adding a little spit and polish to pretty it up.

Views Templates

Views has a neat feature that allows you to create a simple template file to coerce the ugly default output of views into something more presentable. If you created the CCK fields and Views just like I did in part two you can copy and paste the following code into the appropriate files.

Headline Template

[php]

content; ?>

Headline

content; ?>

content; ?>

[/php]

Paste this code into a file called views-view-fields--Headline--block.tpl.php and copy it to your theme folder. The headline view will now output the image followed by the title and teaser. This convoluted file name is actually specified in Views itself by clicking the Information link for the selected View. I simply looked for the file name that most closely matched what I wanted to do.

Features Template

[php]

content; ?>

content; ?>

content; ?>

[/php]

This is the same as the Headline but this time you need to name the file views-view-fields--Features--block.tpl.php.You should now have a fully functioning Headline and Features list.

Categories Template

This get a little complicated for the categories. In this case, you will need to paste some code into your page-front.tpl.php file. Here is the code.

[php]

tid, $terms_to_exclude ) ) {
print t(“

description\”>\n

” . $value->name . “

“);
print views_embed_view($view_name, ‘default’, $value->name);
print t(“

“);
}
}
?>

[/php]

It simply loops over each Term for whatever Vocabulary you specify. During the loop, Drupal makes a call to the posts_by_category View, which returns the five most recent post titles formatted as links.

Just find a good spot for it in page-front.tpl.php file and specify the commented parameters. That is it.

Styles

The last thing you need to do is a few styles to the stylesheet to make everything look nice and tidy. See the attached files for a full example.

Wrap up

It does not take much to style your views if you know file to create. In this case, just a few lines of code did the trick. With a little CCK and Views you have managed to create a dynamic Magazine-style layout for Drupal that is robust and structured.

Download the Framework theme with styles and View templates

Filed Under: Code Tagged With: cck, drupal, views

Code & Tutorials

Which Front-End Development Languages Will Grow in 2017?

Your Guide to Leveraging APIs as a Developer

Bitcoin Processing Website Integration For Web Developers

Website Security For 2016 That All Developers Need To Know

5 Reasons You Need to Be Using jQuery

About Devlounge

Want to read more about Devlounge, or maybe you want to contact us, or even advertise? Oh, and don't forget to subscribe to updates!

The Best of Devlounge

Cool Tools for Creative Blog Content

Search