drupal-max
ตัวอย่างการควบคุมการแสดงเนื้อหา
<?php if (drupal_is_front_page()): ?>
Front<hr>
<?php else: ?>
Not Front<hr>
<?php endif; ?>
<?php if ($node->type == 'building'): ?>
Building !!!
<?php endif;?>
ตัวอย่างการแปลง User Login 3 แบบ
Code Phase 1
<?php if($user->uid) { $t_user = user_load($user->uid); print ($t_user->profile_name); } ?>
Code Phase 2
<?php if($user->uid):
$t_user = user_load($user->uid);
print ($t_user->profile_name);
else:
?>
Login
<?php endif; ?>
Code Phase 3
<?php if($user->uid): ?>
User Name :
<?php $t_user = user_load($user->uid); print ($t_user->profile_name); ?>
<?php else: ?>
Login
<?php endif; ?>
TAbs Link Active
Step 1 Change
<body class="<?php print $body_classes; ?>">
To
<body class="<?php print $body_classes; ?> <?php print isset($_GET['q'])?('my-body-' . str_replace(array('/','_'),'-',$_GET['q'])):''; ?>">
Step 2 Change
#navigation ul#secondary-menu li a:hover,
#navigation ul#secondary-menu li a.active {
To
body.my-body-node-4 #navigation ul#secondary-menu li.menu-299 a,
body.my-body-node-4 #navigation ul#secondary-menu li.menu-313 a,
body.my-body-forum #navigation ul#secondary-menu li.menu-314 a,
body.my-body-node-6 #navigation ul#secondary-menu li.menu-315 a,
body.my-body-node-6-edit #navigation ul#secondary-menu li.menu-316 a,
body.my-body-node-6-edit #navigation ul#secondary-menu li.menu-318 a,
#navigation ul#secondary-menu li a:hover,
#navigation ul#secondary-menu li a.active {
TAbs Button Align Center
#navigation ul#secondary-menu {
text-align: center;
}
#navigation ul#secondary-menu li {
display:inline-block;
float: center;
}
New Region
http://yuriybabenko.com/blog/creating-new-drupal-regions
http://drupal.org/node/281083
Different-page-templateshttp://www.shekhargovindarajan.com/tips-n-tricks/drupal-6-different-page-templates-for-different-content-types/
Copy right
http://www.signore.net/code/copyright_code.php
http://css-tricks.com/snippets/php/automatic-copyright-year/
Table Code
<table border='1' style='background-color:white;border:2px solid black;text-align:center;'>
<tr>
<td>1-1</td>
<td>1-2</td>
<td>1-3</td>
<td>1-4</td>
</tr>
<tr>
<td>2-1</td>
<td>2-2</td>
<td>2-3</td>
<td>2-4</td>
</tr>
<tr>
<td colspan=3>3-1</td>
<td rowspan=2>3-4</td>
</tr>
<tr>
<td>4-1</td>
<td>4-2</td>
<td>4-3</td>
</tr>
</table>
<style type="text/css">
table.sample {
border-width: 1px;
border-spacing: 2px;
border-style: outset;
border-color: gray;
border-collapse: separate;
background-color: white;
}
table.sample th {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: gray;
background-color: white;
-moz-border-radius: ;
}
table.sample td {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: gray;
background-color: white;
-moz-border-radius: ;
}
</style>
<table class="sample">
<tr>
<th>Header</th>
<td>Content</td>
</tr>
</table>
http://www.w3schools.com/css/css_table.asp
http://www.somacon.com/p141.php/
ความคิดเห็น
แสดงความคิดเห็น