how to lay out a custom content type
I'm pretty new to drupal , and I'm amazed by the power of it . for my first practice I decided to build one of my favorite blogs , rogerebert.com . I decided to add a new content type for movie reviews called "review" and开发者_开发技巧 I gave it five fields . title, image,rating(using a star rating module) , writer , and body . it worked fine and as I expected , but I wanna know if I can manage the layout of my content type . I mean by default all of my fields are left aligned , but I want them to be center aligned with each other . and I also wanna know if there's a way to hide the "read more " and "post comment" on the teaser view of every "review " . thanks
Yes, you can use CSS obviously, but you can also leverage the Theming API in Drupal.
You can override a node type output with node-(type).tpl.php, and do a lot more.
http://drupal.org/node/17565
http://drupal.org/node/11816
Create your file, and do var_dump($node); to see what you have to work with.
You can also use a module like ConTemplate.
http://drupal.org/project/contemplate
As you are new to drupal I guess you will want some easy way to modify the layout of your custom content type.
If you want some point-and-clic layout configuration you should use the Panels module [ http://drupal.org/project/panels ].
You can go to admin/build/panels and enable "Node template" option. Then clic on edit and create a new variant. Then you should go to "select rules" and apply the panel only to the content types you want (in your case, if you want to apply a layout only to reviews content type you should select that option in the "Selection rules", then add "Node type: Review")
With panels you can choose between different layouts and put each field where you want. If the layout available do not fill your need you can try "Panels Three Four Layout" Module [ http://drupal.org/project/panels_three_four_layout ] which gives you a nice adaptative grid based layout.
精彩评论