Needs review
Project:
Editview
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2009 at 16:44 UTC
Updated:
11 Sep 2011 at 03:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
matt.robinson1 commentedYes, I love this module but I'm having trouble with the layout.
Does anyone know how to change it? Can it be done easily by editing the CSS file with the module? Or is there some other way?
Here is the output of the view that I would basically like to end up with:
Title-1 | Body-1 | cckfieldA-1 | cckfieldB-1
cckfieldC-1 | cckfieldD-1 | cckfieldE-1 | cckfieldF-1
------------------------
Title-2 | Body-2 | cckfieldA-2 | cckfieldB-2
cckfieldC-2 | cckfieldD-2 | cckfieldE-2 | cckfieldF-2
------------------------
Title-3 | Body-3 | cckfieldA-3 | cckfieldB-3
cckfieldC-3 | cckfieldD-3 | cckfieldE-3 | cckfieldF-3
------------------------
Title-4 | Body-4 | cckfieldA-4 | cckfieldB-4
cckfieldC-4 | cckfieldD-4 | cckfieldE-4 | cckfieldF-4
Any help would be appreciated.
Thanks.
Comment #2
matt.robinson1 commentedAnd here's another variation that I'd like to be able to end up with if possible:
Title-1.......|cckfieldC-1
Body-1......|cckfieldD-1
cckfieldA-1.|cckfieldE-1
cckfieldB-1.|cckfieldF-1
--------------
Title-2.......|cckfieldC-2
Body-2......|cckfieldD-2
cckfieldA-2.|cckfieldE-2
cckfieldB-2.|cckfieldF-2
--------------
Title-3.......|cckfieldC-3
Body-3......|cckfieldD-3
cckfieldA-3.|cckfieldE-3
cckfieldB-3.|cckfieldF-3
Comment #3
tdimg commentedNot possible with CSS, but you should be able to put together your own theme function for editview (function theme_editview_node_form($form) in theme/editview.theme.inc) and play around with that. Basically copy that whole function and place it in the template.php of your theme and rename it to phptemplate_editview_node_form, then refresh the theme cache.
If you let me know where/how the labels should be displayed I might be able to put it together for you.
Comment #4
Silicon.Valet commentedit would be nice if the classes were consistent, so that we could use css to set input widths and move things around.
Comment #5
epicproblem1 commentedI'm having trouble modifying editview.theme.inc
I would also really like to be able to display the fields vertically, instead of horizontally. CSS is ineffective as each field is listed in a td.
Comment #6
bfr commentedi added line display:table to td.editview-field{} in editview.css, and it worked.
To make it look nice, you may also have to modify some other lines, like change some display:inline's to display:table, change some width settings etc, but you'll figure it out pretty easily.
However, i use this only to make new nodes, have not tested how it looks with existing nodes.
Comment #7
jpcwebb commentedAnother way is to incorporate the theme_editview_node_form($form) function into your template.php file, and also add the following array transpose function, and finaly replace the final line of the theme_editview_node_form function with
return theme('table', $header, array_transpose(array($row)), array('class' => 'editview-row')) . $buttons;(note the array_transpose around the array($row))This will put each field as a new line, but you will need to sort the table header out - for instance you could make $header equal to the node type and take it out of the foreach loop to make it a single entry array.
Comment #8
Frodo Looijaard commentedSee also #93177: Various feature requests:
A list view. This would allow more flexible theming, wouldn't it? Or at least, more flexible layout. Some of my taxonomies have long help texts which cause the table to run off the screen.
Comment #9
betoaveigaA quick fix works this way with CSS:
td {
display:block;
height:auto;
}
Obviously your CSS selector must be for only this case of TDs.
Hope that helps!
Comment #10
adf1969 commentedsubscribing
Comment #11
dan3h commentedI also wanted the fields displayed vertically. Here is my fix:
$header[] = $field->label();$cell['data'] .= "<label>".$field->label()."</label>";...just before this one:
$cell['data'] .= $value;$row[] = $cell;... to
$rows[] = array($cell);return theme('table', $header, array($row), array('class' => 'editview-row')) . $buttons;... to
return theme('table', $header, $rows, array('class' => 'editview-row')) . $buttons;Also, in the view itself, I set the "label" of all *checkbox* fields to display as 'none', because otherwise the you get the same label before and after the checkbox. For other types of fields, I left it set to "widget label".
That was my fix, and it works well. Ideally, this theme function should be rewritten to remove the logic-work out into its own function, and leave the theme_...() function as only showing how to display the data. That would make overriding the theme function less clunky.
Comment #12
goatsee commentedHey Dan3h: Pardon my insolence, but I am having a problem with this code which you so kindly posted! I modified my code and lo and behold my editview shows up in one column now (great!) the only problem is that one of my fields, an image/thumbnail, will no longer come up. It's just blank! When I gave it a title, it shows the title, but no image data. I've tried changing the format it's displaying the image in, etc. My guess is that it's something about the array you've set up, no? Any idea?
Thanks all--
D
Comment #13
dan3h commented@goatsee: I'm not sure what that would be from. Any chance you accidentally checked the 'exclude' box on the display settings page (admin/content/node-type/MY_NODETYPE/display), or that you set it to hidden there?
I don't think that my code change would cause what you are descibing, as I'm just rearranging the order of the cells in the table. Perhaps try just the first step that I listed above (simply copying the theme function into your template.php), without changing any more of the code, and see if that works. If you are still having the same problem then, then you have some other issue to figure out.
-Dan
Comment #14
hosais commentedHi dan3h,
I just use your way to make the fields displayed vertically. It seems works perfectly.
Thanks.
hosais
Comment #15
dan3h commentedHi @hosais, thanks for the feedback. Glad to hear it is working for someone else.
Dan
Comment #16
MBroberg commentedThank you, it works! My husband is preparing a patch to the module to allow both vertical and horizontal fields based on your code. it works on my system, we are just new to making patches. Will post shortly.
Comment #17
MBroberg commentedPatch is attached based on code provided in #11.
This is our first time really hacking into code and making a patch so please forgive anything that is not "proper Drupal."
This is a patch for
6.x-1.x-dev from 2011-Feb-24
changing some code in 3 files
I am running it on a live, complex site and so far so good.
Many thanks to my husband for jumping in on this and learning some Drupal code!
The new version offers a display setting in Editview that offers a choice between vertical and horizontal orientation.
Horizontal is the default and works as the original, providing fields in a linear table format.
Vertical is the new choice and gives each field its own row so that fields are stacked. Alternate table row color still applies.
All other changes should be done with css.
The field labels appear twice in the vertical mode. That was a pre-existing issue. Turning off labels in the view is a temporary workaround.
*Note: I am using a vertical Editview with Views Field View and Views Accordion to provide a nice editable form with javascript that expands to show one form at a time.
Comment #18
MBroberg commentedRats, already noticed an issue. After a save and the ajax collapse, the form reopens original table format and the full form instead of selected fields. Was working before. Will start on that tomorrow I guess...
Comment #19
MBroberg commentedOK we found the issues with the display. After an edit, the module was retrieving the default display instead of the fields in the chosen display. Issue is fixed and being tested on my site now, and we will post a patch shortly.
Comment #20
MBroberg commentedOK, there were 2 separate issues, but difficult to separate into two fixes. For the first issue, the js was loading the default view after first edit. We have a patch for just that issue alone at
http://drupal.org/node/1144736
That fix is also included in this patch (attached), which supersedes both the patch at http://drupal.org/node/1144736 and the patch in #17. Apply only this patch to fix both issues at once.
This is still against 6.x-1.x-dev from 2011-Feb-24
Comment #21
tbroberg commentedhttp://drupal.org/node/1144736 has been updated to include a bug fix.
Arguments were not being preserved.
Given the less-than-overwhelming response on this issue, I'm not trying to maintain separate fixes.
Get thee hence if thou needest the fix.
- Tim.