Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 511 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Favorite Drupal tips or best practices?

#11
Use the $id variable in node.tpl.php to make themes allow things other than long vertical lists of content. For example, you could check whether $id is 1, and if so wrap the node in a div which puts it in a big highlight zone at the top right of the page. (This is useful when combined with the 'make sticky at top of lists' function.) Then you could have two columns some way lower down the page, containing $ids between 2 and 8 and 9 and 15.

Sometimes you might need to check something other than the $id number to determine which 'zone' to place a node into. In this case, it can be very helpful to do some of the checking in a hook_preprocess_node function (which you can place in your template.php file as themename_preprocess_node) which contains a static variable which you can use to store the result of checks on nodes which have already been shown on the page. For example, I use this to display a date heading above nodes providing a node of that date has not already been shown, like so:

if ($vars['teaser']) {
static $last_date;
$date = format_date($node->created, 'custom', 'l jS F');
if ( $date != $last_date ) {
$vars['show_date'] = TRUE;
$last_date = $date;
}
else {
$vars['show_date'] = FALSE;
}
}
Reply

#12
Install and use the [devel module][1]. Spend some time with it up front have a more intimate knowledge of how it can help you debug modules, theme development, etc.


[1]:

[To see links please register here]

Reply

#13
[Panels3][1]


[1]:

[To see links please register here]



Learn it, use it, master it. It makes your site highly dynamic.
Reply

#14
I shared some tips in this presentation

[To see links please register here]

.

Note: Fonts in slideshare are F***ed up, its better to download.
Reply

#15
Two pieces of advice:

**Don't** blindly use the first module that shares a name with what you want it to do. Often the first module "captures" the namespace for that feature, but another, less aptly named module will fulfill the functionality better.

Look around for a way to do what you want that includes CCK/Views integration. This is pretty apparently the future of Drupal, so a standalone module that does what you want it to do that competes with a views/CCK-dependent module will probably die out in the near future.

++ to Geshan's suggestion.
Reply

#16
[CCK][1] + [Views][2] + [Panels][3]


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#17
[Framework][1] is another great module for beginning the development of a theme. Using it as a base theme, I was able to port an existing theme to Drupal within hours.


[1]:

[To see links please register here]

Reply

#18
Use exportables, via ctools module or the built in ones for views, etc to get key configuration settings outside of the database and put them into version control. This will make moving updates and changes from one site to another a lot easier.
Reply

#19
If you're not stuck with PHP5 or a non-mysql database, use Pressflow (

[To see links please register here]

) instead of stock Drupal. Pressflow is optimized for mysql+php5 and supports better caching setups as your site grows, such as putting Varnish in front of Drupal for anonymous users.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through