Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <?php if ($fields['type']->content == 'Event'): ?>
  2. <a href="<?php print $fields['path']->content; ?>"><?php print $fields['title']->content; ?></a>
  3. <?php endif; ?>
  4.  
  5. <?php if ($fields['type']->content == 'PATF News'): ?>
  6. <a href="<?php print $fields['path']->content; ?>"><?php print $fields['title']->content; ?></a>
  7. <?php endif; ?>
  8.  
  9. <?php if ($fields['type']->content == 'News Link'): ?>
  10. //This link goes to _blank
  11. <a href="<?php print $fields['field_link']->content; ?>" target="_blank"><?php print $fields['title']->content; ?></a>
  12. <?php endif; ?>
  13.  
  14. if ($fields['type']->content == 'Page') {
  15. // print title linking to node
  16. print $fields['title']->content;
  17. }
  18. if ($fields['type']->content == 'News') {
  19. // print title linking to other website
  20. print 'http://example.com/'. $fields['title']->content;
  21. }
  22.  
  23. $link = $fields['path']->content;
  24. $title = $fields['title']->content;
  25. $options = array();
  26.  
  27. if ($fields['type']->content == 'News Link') {
  28. $link = $fields['field_link']->content;
  29. $options['attributes']['target'] = '_blank';
  30. }
  31.  
  32. print l($title, $link, $options);
  33.  
  34. <?php if ($fields['type']->content == 'xxx') { print 'Test'; } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement