Views 5.1.6 Failure to Comprehend

sunfish62 - September 4, 2008 - 01:53

I am more than a little frustrated by the fact that I can't seem to get a list view of my blog posts that includes the Title, Create Date and Teaser. I have successfully built views that incorporate 2 of the three, but I can't seem to get all three. What I want is:

Blog Title 1
Date 1
Teaser 1

Blog Title 2
Date 2
Teaser 2

...

I have tried views both with the List View and Teaser View types. With the List View Type, I get the Node Create Date to show--but not the teaser, even though it is included in the list of fields to display. With the Teaser view, I get the Teaser, but the Create Date never shows, even though *it* is included in the list of fields.

Any help would be appreciated.
David

Fields are irrelevant in

Jeff Burnz - September 4, 2008 - 02:01

Fields are irrelevant in node views (the teaser list).

Check your display settings for the content type (to control what appears in the teaser), or else modify node.tpl.php.

i have this working with a

WorldFallz - September 4, 2008 - 02:13

i have this working with a list view no problem-- do your teasers work properly in other contexts?

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

Explain Further

sunfish62 - September 4, 2008 - 02:27

Could you explain further? My list view of a blog does not include the teaser. I suspect the other reply is onto something, although with the standard Blog, there are no fields listed under the Display Fields tab.

Honestly, it is highly counter-intuitive to have a View Type which controls both layout and content. In my mind, if I choose a List View (or Table View--or Node View, for that matter), my next task is to select the fields I want to include on the view. Why shouldn't I be able to tell the View that I want to include the Date AND the Teaser on my List View?

I assumed the "date" you

Jeff Burnz - September 4, 2008 - 02:54

I assumed the "date" you refer to is a custom CCK field. If so there will be a display setting for it in the content type.

Just A Blog

sunfish62 - September 4, 2008 - 03:01

No. It's the Node Create Date that comes with any node. I'm working with a Drupal standard blog out of the box.

So for your list view you

Jeff Burnz - September 4, 2008 - 03:10

So for your list view you have:

Node: Title
Node: Created Time
Node: Body (teaser)

That should create an un-ordered list with each list item containing those 3 fields.

Exactly-- this is precisely

WorldFallz - September 4, 2008 - 14:11

Exactly-- this is precisely what I have. When you add the "Node: Body" field just be sure you select the "Teaser" option instead of the "Full Text" option.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

Okay... but

sunfish62 - September 4, 2008 - 17:25

As I explained in my original post, when I do this, I cannot get this result. To demonstrate, I have created a view that has List View selected and these fields in the Fields section of the Views page. The result can be seen at:

http://www.go-two-one.net/?q=testbloglist

As you can see, this does NOT include the teaser. In contrast, when I create a Teaser listing and include the 3 fields in that display, my result is:

http://www.go-two-one.net/?q=testblogtease

As I originally posted, this one does NOT include the date.

Hence my original post. If you have insights on why my site hates to follow my wishes, I am happy to hear them...

Check your theme settings

Jeff Burnz - September 4, 2008 - 18:01

Check your theme settings for submitted by and date information settings (for the teaser list issue).

If you look at your own blog you would notice there is no date or submitted by information on those teasers either, so why would the View be any different? I already clarified the fact that fields are irrelevant in node type views.

You could have always used the search to find this, first result, first comment alludes to the answer:
http://drupal.org/search/node/submitted+by+and+date+information

BTW I was just trying to clarify the situation because your first post is not that clear to me.

Well, Sort of...

sunfish62 - September 4, 2008 - 18:24

Adjusting the theme settings does put the system-formatted date and username up (I toggled that off for blogs because I didn't want the username there because I don't like how it looks), but it begs the question about why one cannot place the date alone on a View.

The point of a view (as indicated on the main project page) is to allow greater control to the site manager to put specific data elements into a view. It is counter-productive then to make it that a particular type of view will NOT allow the site manager to place data elements on these views. Moreover, there is no indication in the UI that this is so; it is apparently something that every Drupal administrator is simply supposed to know.

And certainly, if I had selected just the right terminology to put into a search, I would have found the link you refer to. When I searched for "display date view" (summarizing the problem as I have outlined it) I did not turn up the thread you found. Alas, another demonstration that searching for and finding information is a process fraught with challenges.

Perhaps this has changed in the latest version of Views; I will certainly consider that as I attempt to make the transition to D6.

David

ah ok... but that's a

WorldFallz - September 4, 2008 - 18:11

ah ok... but that's a proverbial horse of a different color from the topic of your op. This is not a "failure to comprehend" but more than likely a bug somewhere. What we've described is the "proper" way to do this but for some reason it's not working for you (it's not a user education issue).

Let's do a little troubleshooting...

1) what do you have for "length of trimmed posts" at admin/content/node-settings?
2) what do you get when navigating to a taxonomy page (like http://mysite.com/taxonomy/term/1)?
3) what does it say at admin/content/types/blog for "body field label"?
4) what additional modules have you enabled?

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

Answering your questions

sunfish62 - September 5, 2008 - 19:31

1) I have 200 there.
2) I get displays of nodes with the selected term
3) "Body"
4) Modules:
CCK: Content, NodeReference, Number, Text
Core Opt: Blog, Color, Forum, Menu, Path, Taxonomy
Image: Image, Image Gallery, Image Import
LightBox2, Acidfree, ActiveSelect, BookReview, FCKEditor, Quotes, Recipe, Weight, jQuery Update, Video, Video Image, Views, View UI.

Cheers,
David

Nothing looks out of place

WorldFallz - September 5, 2008 - 19:44

Nothing looks out of place there and i don't see any obvious modules that would affect teaser output. can you post or pastebin your exported view (the list one that doesn't have the teaser)?

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

Here's The View

sunfish62 - September 6, 2008 - 04:09

$view = new stdClass();
$view->name = 'BlogWithDateOnly';
$view->description = 'Blog listing reverse chronological order with add date';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Blog With Date List Type';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'list';
$view->url = 'testbloglist';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'created',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'node',
'field' => 'created',
'label' => '',
'handler' => 'views_handler_field_date_custom',
'options' => 'F jS, Y',
),
array (
'tablename' => 'node',
'field' => 'body',
'label' => '',
'handler' => 'views_handler_field_teaser',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'blog',
),
),
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
);
$view->exposed_filter = array (
);
$view->requires = array(node);
$views[$view->name] = $view;

Works for me without

Jeff Burnz - September 6, 2008 - 04:47

Works for me without issue.

I can see in your test list page <div class='view-field view-data-node-body'></div>, so its trying to load the teaser but something is freaking it out - the divs print but no content between them.

Try a couple of things - edit/save a couple of those blog posts AND clear the Views cache. In one of my sites I find occasionally the teaser doesn't print, most times re-saving the node fixes it up - perhaps this might work for you.

How weird. Nothing seems to

sunfish62 - September 8, 2008 - 05:14

How weird. Nothing seems to fix this for me. I guess I'll begin thinking about migrating to D6 and see whether I can get it to work there.

You mention "clearing the Views cache"--what is that, and how do you do it?

In the main views page,

Jeff Burnz - September 8, 2008 - 07:05

In the main views page, there's a tab at the top "Tools", go there. I doubt that's the issue, worth a crack though.

Thanks for the lead, but you

sunfish62 - September 8, 2008 - 19:53

Thanks for the lead, but you were right, that did not fix things.

I notice now that I have oddities in display that suggest some sort of trouble with my theme. Specifically, many list elements seems to lack their graphic bullet, a circumstance that comes and goes as one tabs through the links on page. I assume that this is not normal behavior (that is, that the Garlard theme is built to work reliably on many common platforms), and perhaps it indicates some weirdness on my site. But thanks for helping me see that the trouble is likely on my end, and for the additional troubleshooting assistance.

David

one easy way to see if it's

WorldFallz - September 8, 2008 - 20:10

one easy way to see if it's theme related-- switch back to stock garland and take a look.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

yep, the view is ok. works

WorldFallz - September 6, 2008 - 14:04

yep, the view is ok. works for me too. definitely try resaving the node as jmburnz says. Also, try manually setting the teaser with <!--break-->

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

 
 

Drupal is a registered trademark of Dries Buytaert.