- Accessibility
- Actions
- Blog
- Bootstrap
- Calendar
- Code Snippets
- Core Hacks
- Cron
- Development Environment
- Drupal 7
- Flash
- Forms
- Goodies
- Hooks
- Hosting
- Images
- Installation, Updating and Moving
- Internationalization
- Javascript/JQuery
- Learning Drupal (New Users)
- Login/User Management/Permissions
- Logs
- Menus
- Modules
- Nodes
- Paths
- Performance
- RSS
- Reference Sites
- Registry
- Reporting
- Reporting Bugs/Issues
- SEO
- Schema
- Search
- Security
- SimpleTest
- Sites
- Support
- Testing
- Themes
- Troubleshooting
- Upgrading
- User Groups
- Workflow
Submitted by captaindav on Mon, 2009-06-08 09:04
See if field exists:
if ($node->field_name) or isset($node->$field_name)
Debugging, to display an array:
<?php print '<pre>'. check_plain(print_r($profile, 1)) .'</pre>'; ?>
In a block, toggle image based on whether or not the user is logged in or not logged in (annonomous).
<?php global $user; ?>
<?php if (!$user->uid) { ?>
<P><A href="/user"><IMG class=mceItem alt="" src="/sites/all/themes/church_default/images/member_lg.jpg"></A></P>
<?php } else { ?>
<P><A href="/logout"><IMG class=mceItem alt="" src="/sites/all/themes/church_default/images/member_lg.jpg"></A></P>
<?php } ?>
Create and theme an image link using l:
l(theme('image',blah),node/blah, array('html' => TRUE));