Views

Sidebar graphics with links ("promotional badges") the Agaric Drupal way

Key words and phrases: 
show graphics in sidebar on certain pages linked to featured sections easily change graphics in specific sidebar block regions
Description & Info: 

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

Description & Info: 

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.

by Benjamin Melançon
Posted on Tue, 2008-04-15 10:40
in

Ask Agaric: Views Block and Page with Different Fields

Key words and phrases: 
block views page view different fields
Description & Info: 

E-mail subject: Please help me with views???

Tony sent a message using the contact form at
http://agaricdesign.com/contact-us

Hi 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:

by Benjamin Melançon
Posted on Sun, 2008-03-16 17:25
in

A silly trip through the innards of views theming: output plain link with no HTML

Key words and phrases: 
theme div class field-item avoid skip solution views do not group multiple values
Description & Info: 

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

Key words and phrases: 
theme view drupal body text only drupal input format apply body drupal views display raw field Drupal body field exposed to view
Description & Info: 

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

Key words and phrases: 
avoid redundant Views code in template.php view callback views phptemplate
Description & Info: 

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.

by Benjamin Melançon
Posted on Mon, 2008-01-07 21:15
in

Theme (lots of) views the Agaric way: Background

Key words and phrases: 
theme view with template condense views theming wizard output
Description & Info: 

Go straight to the useful, how-to information: http://agaricdesign.com/note/how-theme-lots-views-agaric-way

Condensing the wisdom of the wizard

by Benjamin Melançon
Posted on Mon, 2008-01-07 10:27
in

Make a Drupal action that can be used with views node operations (disable comments on node exampe)

Key words and phrases: 
actions module views node operations custom action to disable comments on a node
Description & Info: 

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

Key words and phrases: 
Drupal view with tabs Drupal views as local tasks on page Drupal turning menu paths into local task tabs how to generate the “local tasks” tabs
Description & Info: 

&lt;?php print theme_menu_local_tasks(menu_get_local_tasks()); ?&gt;

“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.