Closed (fixed)
Project:
Composite Layout
Version:
6.x-1.0-beta6
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
22 Dec 2008 at 20:40 UTC
Updated:
30 Jan 2009 at 14:10 UTC
This module is a good alternative to panels-based nodes, and really helped on a project.
I find it to be much easier to use if you can get a small preview of the field contents when selecting and sorting the elements into zones.
The attached patch modifies _composite_references_preprocess to pass the $node object so that field previews can be rendered.
It also removes the empty parent field in instances where multi-value fields are used.
| Comment | File | Size | Author |
|---|---|---|---|
| composite.patch | 6.45 KB | agentrickard |
Comments
Comment #1
bengtan commentedHi,
Thanks for this patch. You're right, it does make things easier.
However, I'm considering making a minor change or two to the patch before committing. Among other things, _composite_cck_preview_element() might go into composite.module since it's not really CCK specific.
I will try to spend some time on this in early January. Let me get back to you on it, but if I seem to be taking too long, feel free to bump this issue.
Thank you.
Comment #2
agentrickardNot a problem.
Comment #3
agentrickardThe patch does not work correctly with Filefield, since the UID handling falsely returns the UID. So this patch needs some more love. I added an FID if check handler to
_composite_cck_preview_elementas a temporary fix.Comment #4
agentrickardComment #5
bengtan commentedHi,
I'm looking at this issue now, and merged your patch into my own private repository (which I will later propagate to drupal CVS).
But ... I modified your patch slightly in the process (no functional changes, just some syntax transformations).
Do you want to communicate to me the changes you did for comment #3?
Either a new patch (from your system), or a code description will do. I can do the necessary merging and then commit to drupal CVS.
Comment #6
agentrickardI just added an 'fid' IF statement between the NID and UID checks in _composite_cck_preview_element().
Comment #7
bengtan commentedComposite Layout 6.x-1.0beta6 has been released with your proposed functionality. Please use and let me know how things go. Thank you for your input.
Comment #8
agentrickardNice. I found one small bug that occurs if we have an empty multivalue field.
Fix is line 85:
Adding the !empty($item) prevents the foreach from running when there are no values.
Comment #9
bengtan commentedHi,
I hope you didn't mind me mangling your patch before committing. Maybe didn't quite conform to Drupal collaboration conventions, but anyway ...
I'll take your word for it that comment #8 is a fix, and will commit to CVS sometime soon.
Comment #10
bengtan commentedThe change from comment 8 has been committed to CVS and will be incorporated into the next release of Composite Layout, whenever that is. Thank you.
Comment #11
agentrickardWorks for me. You have to be comfortable with the code you commit.