this is a little fix for two things about 'grid', 'unformated' and 'list' type of displays :
. row style settings : inline and block fields works everytime.
in my case when I have 4 fields A B C D, I didn't manage to obtain a display like :
A B
C D
either I obtained A B C D (inline option checked for each field)
or
A
B
C
D
(B and D checked)
now B and D checked give :
A B
C D
. the inline separator (in row style settings options) is now displayed, and only if the previous field is not empty, thus to avoid something like :
(/ is the inline separator)
1.a title / a cck field
terms / [more..]
2.another title / a cck field
/ [more..]
the second separator in 2 is useless.
in fact it's just a mod on one of the views templates, views-view-fields.tpl.php. the file is attached. (rename it views-view-fields.tpl.php, place it in your theme directory rather than in the views theme template, then clear the cache)
AND ALSO a modification (correction ? I don't now -yet) of theme.inc in views/theme folder, line 178 :
replace :
if (!empty($vars['options']['separator']) && $inline && $object->inline && $object->content) {
$object->separator = filter_xss_admin($vars['options']['separator']);
}
by :
if (!empty($vars['options']['separator']) && $object->inline && $object->content) {
$object->separator = filter_xss_admin($vars['options']['separator']);
}
IMPORTANT :
. I added some variables in the template, that should be unique in most of the case I guess, BUT it needs review as they are not standards, 'drupal-normalized'. I'm a bit new to drupal.
. code needs optimization, at least for 'for if else endif' syntax.
. needs review (works fine at least for me until now=)
hope this will help,
littleneo
| Comment | File | Size | Author |
|---|---|---|---|
| views-view-fields.tpl_.php_.txt | 1.94 KB | littleneo |
Comments
Comment #1
merlinofchaos commentedCan you please submit an actual patch?
Comment #2
littleneo commentedin fact I don't know yet how to generate them.. moreover it's just one line and I think it needs reviews for variables and code quality.
but if you want, just let me 4-5 days for some time left and to understand how to generate a patch.
Comment #3
merlinofchaos commentedUnfortunately, by attaching a whole file I have to visually compare the file to the existing file to see what has changed. THis is especially true of other changes have been made to that file since you made your changes. You don't want to undo previous patches inadvertantly.
Doing that manually takes considerable time.
If you've got a checkout from CVS, generating a patch is very easy. Simply make your changes and then type cvs diff -up > patchfile.patch
The checkout from CVS is probably the more difficult part, but even that isn't too difficult. See http://drupal.org/repos
Comment #4
esmerel commentedNo updates in over a year; this can't have been that critical.