Hi!
I found a regression with views : when selecting to display inline fields, they appear one after each other instead of next to each other, like it was before. An example :
$view = new view;
$view->name = 'essaiview';
$view->description = 'essai random';
$view->tag = 'random';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'status' => array(
'id' => 'status',
'table' => 'node',
'field' => 'status',
),
));
$handler->override_option('sorts', array(
'random' => array(
'id' => 'random',
'table' => 'views',
'field' => 'random',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('row_options', array(
'inline' => array(
'status' => 'status',
),
'separator' => '',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'random');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
Any hint about it?
Thank you!
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | viewsRC3.png | 190.03 KB | sebos69 |
| #8 | viewsRC4.png | 123.86 KB | sebos69 |
Comments
Comment #1
merlinofchaos commentedI don't understand. That view has only one field. Is that really a good example?
Comment #2
sebos69 commentedWell, that's not the view I am actually using (I was using a view to display images thumbnails on the same line). So I tried a simpler view to remove the dependancy to imagefield.
My real view is this one;
do you need more info?
Comment #3
merlinofchaos commentedImages tend to be block elements, so you probably have to CSS them to be inline.
Comment #4
sebos69 commentedIt worked out of the box with previous RC-versions of views. I can check the exact number tomorrow if you want (not at work right now).
Comment #5
merlinofchaos commentedIf the problem is only with imagefields, then the report should go against imagefield, since that module controls how images are laid out. I'm 99.9% sure that Views does nothing to affect this. It may be possible that imagefields are declaring themselves as block entities, which means Views won't display them inline, but that's up to imagefield code.
Comment #6
sebos69 commentedYou most probalby are right on this :). In order to find out who is the culprit between views and imagefield, I tried to display an other field than the image thumbnail. Then I chose to display the "published" status. But the content was still not displayed inline. Are there restrictions on the use of the "inline" option? i.e. whith which field(s) is it supposed to work?
Comment #7
merlinofchaos commentedViews will automatically not be able to inline any field which is run through Drupal's HTML input filters, as those will always be encapsulated in
<p>tags which are block elements and thus not valid to be inside<span>tags. After that it shouldn't be any fields.You might take a look at the source code and see what the HTML being generated actually is. Views doesn't do much here, it just picks DIV or SPAN based upon whether or not its inline. If it's a span and still shows up not inline, there is something (CSS or otherwise) that is causing the data to be a block element, which will add newlines. It's difficult to diagnose genericly, as well.
Comment #8
sebos69 commentedOK, I've been digging some more... Here are my results :
-with views-6.x-2.0-rc3 the images display inline as desired (see file viewsRC3.png)
-with views-6.x-2.0-rc4 the images display one on top of each other (see file viewsRC4.png)
I have identified the culprit : it is the file theme/views-view-unformatted.tpl.php
for -rc3, this file is :
and for -rc4 :
overriding the -rc4 file with the -rc3 version restores the original behaviour (verified also for the 2.1 release)
I am definitely no php coder, so I do not understand the subtility under this change, but what would you suggest me to do next?
Thanks for your patience...
Comment #9
merlinofchaos commentedOh!! You're trying to have thumbnails in *different rows* appear inline. That was never intended functionality. You were in fact taking advantage of a bug, where each row wasn't properly wrapped in a div.
You're probably best off just theming the view the way you want it for now.
Comment #10
sebos69 commentedgee, first time I like a bug ;). Will try to theme the view :). Sorry for the noise...
Comment #11
merlinofchaos commentedNo worries there. You could probably also turn the div inline with a quick bit of CSS too. Something like .view-VIEWNAME div.views-row { display: inline; }
Comment #12
zilla commenteddealing with something mildly similar and exploring this way to handle it (if you've put in via cck!) http://drupal.org/project/form_markup
Comment #13
mattyboy commentedHi all,
Sorry to open this thread up after such a long time but I'm having a similar problem and wondered if anybody could spare the time to help.
Here's a link to illustrate the problem-
http://test.3photoshop.com/rainbow-video-tutorial-photoshop
I'm using views, panels, and CCK (all most recent versions) to build the pages. You'll see two panels with identical thumbnails at the top of the page, if you look at the first one, the text doesn't sit inline with the image. The text is a node body (or at least it will be, at the moment it's just some global ccustom text), and the image is generated via Imagefield through CCK. The panel is put together using a view, but no matter how hard I try, I just can't get the text to sit inline with the image. It's already been said in this thread that it's probably due to the imagefield object being wrapped in
tags, but my question is - is there any way around this problem?
The lower panel is created by adding the thumbnail to the body field inside the node. Not ideal as it creates way more work than is needed, but this is how I would love the final solution to work.
I will post over at the Imagefield support queue if you feel that's the best option, but I just wanted to know if anybody had found any tried-and-tested techniques? The CSS above doesn't seem to work for me, although I posted it in my local content file?
Any help or pointers would be greatly appreciated.
Many thanks
Matt
Comment #14
merlinofchaos commentedActually you are misunderstanding what inline means.
In the first panel, the image *is* sitting inline with the text. That means the image is treated just like another word. The fact that it's really tall makes it look *very* silly to do that.
Your answer is that you need to add some CSS to float the image. Inline is not the answer.
Comment #15
mattyboy commentedHi merlinofchaos ,
Thanks for that, I see what you mean.
Where would I add the CSS, I can' seem to trace anything using firebug or web developer?
Thanks again
Matt
Comment #16
merlinofchaos commentedThere's an advanced help topic in Views on theming, that might help. You'll probably add CSS to your style.css in your site's theme.
Comment #17
mattyboy commentedThanks a lot, I'll check it out, try a few things, and see how it works.
Thanks again
Matt
Comment #18
mattyboy commentedWell after 7 hours of fiddling around I managed to write some CSS to alter individual fields of the view in question. I've written it in my local.css file and everything's working fine....except for......I still can't get the image and the text to align correctly (the text wrapping around the image). Here's the css code I'm using-
I realise this isn't a css support forum, but I still think that views plays a big role in my inability to get this to work. That as well as my inexperience :o}
I'd appreciate any help any body out there is willing to give!
Matt
Comment #19
stephthegeek commentedmattyboy, you need to make sure it's the class on the img tag that's getting the float. I don't see the above CSS in your link but adding float: left; to .imagefield-field_vid_thumb {} in firebug wrapped the text just fine for me.
Comment #20
mattyboy commentedHey stephthegeek,
Thanks so much for that, worked perfectly! I'm using a local content file so that's probably why it can't be seen. Thanks again.
merlinofchaos, just realised you are THE Earl Miles, wow, thanks for helping and thanks again for an awesome module!!
Regards
Matt