Archive | Drupal RSS for this section

Embed flash to website

To embed flash to your website, you can use this:

<embed height="138" loop="true" menu="true" play="true" pluginspage="http://www.macromedia.com/go/getflashplayer" src="/path/to/files.swf" type="application/x-shockwave-flash" width="840" wmode="transparent"></embed>

Use wmode=”transparent” to make the flash below the html (especially in IE). For some cases, in IE the flash is always on top of other html even if you use z-index positional. Use wmode=”transparent” to fix this problem.

Print taxonomy term in node without link in drupal 6

Put these lines to your node.tpl.php file:

<?php if ($terms): ?>
<?php
$vocabularies = taxonomy_get_vocabularies();
foreach($vocabularies as $vocabulary) {
if ($vocabularies) {
$terms = taxonomy_node_get_terms_by_vocabulary($node, $vocabulary->vid);
if ($terms) {
print '<span class="taxonomy">';
foreach ($terms as $term) {
print $term->name;
}
print '</span>';
}
}
}
?>
<?php endif; ?>

Source: http://drupal.org/node/317172

Create Image slide using javascript on Drupal

If you want to create an image slide on Drupal, one way to do it is using javascript. Here are some samples:

There are prev and next button to control your image slide. Your image will be play automatically, but you can control with button.

Here is the step by step:

  1. Download the javascript from here.
  2. Extract to your theme folder.
  3. Read More…

Drupal: Print User Profile in Body Content

I need to print user custom profile on my content body. I just need these code for print out my user profile.

<?php global $user; ?>
<?php $profile =  profile_load_profile($user); ?>
<?php print $user->profile_company_name; ?>
<?php print $user->profile_company_address; ?>

print drupal parameter in content body

I need to print user’s picture in the body of my content so I use the php input format and add this following lines:

<?php
global $user;
print $user->uid;
?>

To view all attributes of the user:

<?php print_r($user); ?>

Drupal CSS for forms, collapsible settings, comment

Just want to share some drupal css for forms, collapsible admin settings, and comment border.

/* make form radios and checkboxes inline with its label */
.form-radios .form-item p, .form-checkboxes .form-item p{
display: inline;
}
.form-item label.option, .form-checkboxes label.option{
display:inline;
font-weight:normal;
position:relative;
top:4px;
}
.form-checkboxes, .form-radios {
margin:0;
}

/*———- collapsible setting ————-*/
fieldset {
border:1px solid;
display:block;
padding:10px;
position:relative;
}
html.js fieldset.collapsed {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent none repeat scroll 0 0;
padding:10px;
}

/* give dotted border for margin that is published */

.comment-published {
margin-left:10px;
padding:10px;
border:2px dotted #DBDBDB;
}