User login

Views

Give custom blocks template suggestions by type and views blocks by view ID

<?php
/**
 * Implements hook_theme_suggestions_HOOK_alter() for blocks.
 */
function kidneys_theme_suggestions_block_alter(array &$suggestions, array $variables) {

Views creating blank rows? Check your node type filtering

The 'Items to Display' in Views is set to 10. The number of blank lines that show are the difference between the limit in Views and the actual number of items in the table. So in this example, there are 7 extra blank lines (odd/even coloring) in Firefox -- there are no extra blank lines in IE.

Agaric wrote:

First of all look at the source code in both browsers and you'll see that's the same, and it might tell you more about what the extra lines are.

Provide an 'Add New' link on a simple view for easily creating more content to list

It's a common situation– you create a simple view that may do little more than filter on one content type in order to get a listing of press releases or links or recipes.

Sure, you can explain to your client and users that going to "Create content" and clicking press release or link or recipe will, when the post is submitted, get it automatically listed on this Views page. And that's pretty nice. But it's a lot more intuitive if the link to create relevant content were right on the view itself.

Relating nodes by taxonomy with Views 2 relationships?

benjamin-agaric: a Views 2 question-- we have two content types (one for images, one for posts) connected to the same vocabulary, we would like a view of the images (actually a CCK field on a node type) where the link from the image goes to the single post tagged with that term. Now I'm thinking this is such an edge case I should just do it in the theme like always. But--

[these next messages were all sent pretty much simultaneously]

merlinofchaos: You probably need a custom field for that.

Using the taxonomy term associated with a node as an argument in a view

How to in Views 2

Using a taxonomy term associated with a node as the argument in your block view. In the original Views module, the PHP Argument handling code was a collapsed fieldset that opened to reveal a textarea in which to input code. In Views 2 this is still necessary, unless we're missing out on some uber-advanced method, but harder to get to.

Views 2 discussion at Drupal Camp NYC 5

Views 2 Relationships: Let's you get information that's one step away.

For instance, you can get content based on when users joined or something.

Add a relationship for Queue.
Add the Questionable Content queue.

Now we can use the in-queue filter: it has to be in that queue to show up in the view.

pretty slick.

And then you can sort for nodequeue.

Generally if you're thinking of writing an SQL filter do do what a views does, you can figure it out yourself.

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

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!

Amazing what's available to a simple view in Drupal 5.

A views-list-agaric_view_name.tpl.php with the following sole contents:

Syndicate content