How to use my custom template ?

theuros - October 22, 2009 - 10:47

hi to all

i'm new in drupal ....

befor i used a CMS of my company where i worked wich had very nice template engine ... i'm looking something similar in drupal ..

how to... ?

i have main template with variables $content and $right, i want to have list of news in $right, so i used module "views" ... this module let you override default templates with your own wich is cool .. but for one single news block i need at leat 2 templates ..

first for news block "views-view--News--block.tpl.php" and then for each news "views-view-fields--News--block.tpl" .. this bothers me .. i want to have entire news block in one template ...

in CMS i mentioned before i done it like this:

main_template.php => like in drupal here i have $content, $right
then i have block_news.php ...

in CMS i just defined ... what function (articles list) what template ( block_news.php ) where ( $right ) ... and this is it ..

CMS function articles_list makes an array of news i need so code in block_news.php is like:

<?foreach($articles as $a){?>
<?=$a['title'];?>
<?=$a['summary'];?>

<?}?>

$article is result of CMS query ...

how can i do something like that in drupal ? i want to have total control over hmtl in one template !

thanx for the answers and sory for my bad english..

> i want to have total

joachim - October 22, 2009 - 10:51

> i want to have total control over hmtl in one template

You can't. At least not with Views.
If you code the query yourself, you could set up your own template, but it's really not worth it.

...some other module ??

theuros - October 22, 2009 - 11:55

if can't be done with "views" is there any other module wich can do something similar ?

Not really. The module for

joachim - October 22, 2009 - 21:38

Not really. The module for making custom lists of stuff is Views.
If you want more control, you can always write your own list of stuff -- look at blog and taxonomy for examples.

anyone ??

theuros - October 22, 2009 - 17:36

anyone ??

ok... is here any drupal

theuros - October 23, 2009 - 06:05

ok... is here any drupal master who can at least point me in the right direction ?

Can't Understand!

danreb - October 23, 2009 - 07:34

I can't understand what you want to do, but if you want to take control or create a custom template or assign a custom template to an existing block that you created then investigate or installed this module

http://drupal.org/project/blocktheme

This module will allow you create different template for each Drupal blocks.

i want to do...

theuros - October 23, 2009 - 09:21

i want to have total control over output html and styles .. so i don't want module like "views" generate any html and css with data for me .. i just want raw data output for rexample of list of articles or list of categories .. then i can with mix of php show that data on page like i want ...

is this possibile ?

i was clear enought ?

 
 

Drupal is a registered trademark of Dries Buytaert.