Views
Sidebar graphics with links ("promotional badges") the Agaric Drupal way
A note of warning about the length of notes to follow: This is site configuration at the point where it verges on developer documentation, such is the power of Drupal, and there's some outright theming in here too. This article is a reaction to doing sidebar graphics the painfully non-Drupal way.
Drupal theming consulting- Panels and Views questions
Hi Benjamin,
Looking forward to talking tomorrow. I do have some questions ready so I'm inserting them below. I suspect we won't get everything covered in 30 minutes so if you do have time to extend to an hour that might be a good idea. I can pay ahead of time if you wish.
Ask Agaric: Views Block and Page with Different Fields
E-mail subject: Please help me with views???
Tony sent a message using the contact form at
http://agaricdesign.com/contact-usHi Ben,
My name is Tony and I have been reading allot of your tutorials on your
site and the reason that I am emailing you is that I have a problem with
views and I was wondering if you could be so kind in helping me out?Heres the story:
A silly trip through the innards of views theming: output plain link with no HTML
Spoiler: if you want a plain value of a field to be output plain without surrounding <div class="field-item"> tags, make sure to select "Do not group multiple values".

Now for the masochists, let's follow how I found this out the really, really, really hard way!
Use just the body field in the view of a CCK node
This requires theming the view. Views does not know about or provide just the raw body, so you have to theme the view, load the node, and grab the body field.
In your view-....tpl.php:
<?php
$fullnode = node_load($node->nid);
print check_markup($fullnode->body, $fullnode->format, FALSE);
?>*THIS HAS SIGNIFICANT PERFORMANCE IMPLICATION FOR MANY NODES WITH MANY FIELDS*
To print just the body of a node, the body in the sense of a body field in a node that has other fields, place this in your view-....tpl.php file in your theme:
<?php
$fullnode = node_load($node->nid);
print check_markup($fullnode->body, $fullnode->format, FALSE);
?>How to theme (lots of) views the Agaric Way
I3IVIIVI: now, take a look at the template.php file
(10:20:54 AM) Dan Hak: you took out repeating code?
(10:21:15 AM) I3IVIIVI: yes, exactly
(10:21:22 AM) I3IVIIVI: the code that you knew was repeating
(10:21:35 AM) I3IVIIVI: because you weren't even copying it from the wizard anymore
(10:21:49 AM) I3IVIIVI: you were just changing that one spot :-)
In template.php – the generic function followed by an example of a specific invocation. Automatically using a views-list-thememe.tpl.php file if it exists is not implemented with this code.
<?php
/**
* Generic function to theme views, invoked by view-specific callbacks.
*
* Based on code generated by the views theming wizard
Agaric Question of the Day: Why Does Sticky Need a Descending Sort in Views?
If things are ordered first by what's listed first in sort order, why should Views care whether Sticky is ascending or descending?
And if it does care, why can't it have a sensible default?
Yes, I looked silly in front of a client because I didn't read the not-so-fine print:
Node: Sticky
Sort by whether or not the node is sticky. Choose descending to put sticky nodes at the top.
Theme (lots of) views the Agaric way: Background
Go straight to the useful, how-to information: http://agaricdesign.com/note/how-theme-lots-views-agaric-way
Condensing the wisdom of the wizard
Make a Drupal action that can be used with views node operations (disable comments on node exampe)
First of all,to use this action, install http://drupal.org/project/views_bulk_operations
Putting several nodes or views on a page as tabs
<?php print theme_menu_local_tasks(menu_get_local_tasks()); ?>
“local tasks” are things like view, edit, track. they are usu. styled as tabs. menu_get_local_tasks() gets the menu structure in an array.
Menu Local Tasks - Tutorial?
http://drupal.org/node/122262
mdixoncm - February 24, 2007 - 13:12
2 simple steps to understanding local tasks.
