November 7th, 2008
Drupal Path to current theme
<?php
print '<img src="'. path_to_theme() .'/images/picture.jpg" />';
?>
Drupal Path to a theme
<?php
drupal_get_path('module', $module_name);
?>
Drupal Path to a module
<?php
drupal_get_path('theme', $theme_name);
?>
Tags: drupal path, path to module, path to theme
Posted in Some Tricks, Uncategorized | No Comments »
November 6th, 2008
I found a simple tutorial for newbie.. !!!
Click here… I spend more than one hour to find out this.. Pity me !
Posted in Theming, Views | No Comments »
November 1st, 2008
Spending some time trying to find out this !
Sigh…
If you make additional menu and wants to put it in your theme, this is how to do it
<?php print theme('links', menu_navigation_links('menu-machine-readable-name'), array('id' => 'menu_id', 'class' => 'menu_class')); ?>
Posted in Theming | No Comments »
October 28th, 2008
This might not be the best, might not be the lightest, or might not be your favorite !
But I like it..
FCKEditor is my choice.
Download the module here
Download the editor here
Posted in Fckeditor | No Comments »
October 28th, 2008
Want to get all nodes classified under specific taxonomy?
Here we go:
<?php
$result = taxonomy_select_nodes(array($node->taxonomy[1]->tid));
while ($row = db_fetch_object($result)) {
print $row->nid."<br />";
}
?>
Posted in Taxonomy | No Comments »
October 28th, 2008
Let me introduce you to some Drupal APIs
Node Load
to load a node variables
$node = node_load($nid);
Node View
To load a node teaser/full body view
$node = node_load($nid);
print node_view($node)
Posted in Drupal API | No Comments »
October 28th, 2008
If you need a search engine friendly URL in drupal (who dont need anyway), pathauto is your best friend
Download PathAuto
Required Module: Token
Must Activated Core Module: Path
Posted in PathAuto | No Comments »
October 27th, 2008
Don’t know what text to put in? Try Lorem Ipsum Generator. Click here
A bit introduction
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
.
Posted in Some Tricks | No Comments »
October 27th, 2008
Need to put images in horizontal order and in scrolling div?
Here’s the trick
<ul style="overflow: auto; width: 200px; white-space: nowrap;">
<li style="display: inline">IMG HERE</li>
<li style="display: inline">IMG HERE</li>
<li style="display: inline">IMG HERE</li>
<li style="display: inline">IMG HERE</li>
</ul>
.
Posted in Some Tricks | No Comments »
October 27th, 2008
If you want to use two presets or more, you can use this code..
Sigh.. Wasting hours looking for this answer.. Silly me !
<?php
print theme('imagecache', $preset, $image['filepath'], $alt, $title, $attributes);
?>
This is the example…
<?php
print theme('imagecache', 'small', 'test.jpg', 'just a test image', 'test image');
?>
..
Posted in Image Cache | No Comments »