Closed (fixed)
Project:
Composite Layout
Version:
6.x-1.0-beta8
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Sep 2009 at 03:15 UTC
Updated:
18 Aug 2010 at 19:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
bengtan commentedFeature request noted ... Unfortunately, I'm not sure when I'll have the spare capacity to implement it. Sorry.
Comment #2
ericinwisconsin commentedI understand. I appreciate your module and that you noted the feature. Thanks!
Comment #3
simmoe commentedSubscribe - I think this feature is really important :) Doing a bulk update of a lay-out set for existing nodes is really rather necessary on a large site- right now i'm begging my designer wont ask me to change the order of fields in our most common nodetypes- it'll take me a half day to change the nodes manually.
Would economic support do any help - in that case how and how much?
Love this module!
Simon
Comment #4
bengtan commented(@3: Thanks for the offer. It's only because of the commercial prospects that I am giving some thought to this at the moment. I will contact you privately when it's time to talk about commercial matters. However, that's too early at the moment, because I need to work out the required behaviour first.)
Hmmm ... this is actually not immediately straightforward - I have to think of a way to do things safely without accidentally deleting user data (which would be really bad).
So, let's discuss some requirements.
I think 'applying a layout set' in this set shouldn't replace the existing layout set of existing nodes. It would have to only add fields. Blindly replacing the entire layout could very well result in overwriting user data.
Would that be satisfactory for both your respective situations?
Else, I'd have to add in some extra data to remember which nodes have their layout manually configured, and only update nodes which have a layout which has not been altered since being assigned - which is messy, troublesome and I'd rather not have to do.
Any thoughts?
Comment #5
ericinwisconsin commentedJust adding new data would be acceptable for my personal situation, but what if a situation is the opposite, and some data has to be removed?
I understand the way you have things set up. The chosen layout set is essentially applied at the time of node creation, then the node is assigned to the composite layout template the layout set is based on.
For example, I have a website about old magazines that includes nodes with data about the magazine and a picture of the cover. I created a layout set called "Issue Layout Set" that is applied to that node type at the time of creation. The "Issue Layout Set" is based on the "Two Columns" composite layout. Rather than create a new .tpl file every time a layout set is created, the newly-created node is assigned to its corresponding composite layout.
Therefore, when one changes the layout set, it doesn't change every node created with that layout set. Changing the node's layout isn't as easy as just clicking the edit tab and saving it. The changed layout set has to be reapplied to each node by someone with the permissions to change the composite layout by choosing the original layout set.
This is kind of long-winded, I guess, but I'm trying to make things clear in my own mind.
How about this for a fix: When a layout set is created, a new .tpl file is created in modules/composite/theme that corresponds to the new layout set. The node that's created is assigned to this new layout set .tpl file so that if the .tpl file is changed, all nodes made with it are also changed?
Does this sound doable or am I babbling?
Comment #6
simmoe commentedAh ok Bengtan, after reading your reply and thinking a while I now understand your concern (my brain is very slow : )). Of course, the choice to update all nodes of a certain type with an existing lay-out set, should somehow be optional. So basically what i need is more of a "reset" function - see the attached pic.
This sollution could then over time be expanded with an advanced option to only change nodes that have not been customized.
What do you think?
Best,
Simon
Comment #7
bengtan commented@6: The 'reset' button as you've described it, is quite elegant and intuitive, so it'll be straightforward to implement.
@5: Pushing aside the implementation details for the minute and just thinking about the design, I think what you're trying to describe is some way of flagging some nodes so that they can get automatically updated.
(Whether this is done via a separate .tpl.php file, or via some new node variables, is a decision that can be postponed for this discussion)
Those which haven't had their layout modified from the layout set can be optionally updated when the site administrator decides 'Oh, I want to update this layout set for all applicable nodes'. Does this agree with what you had in mind?
Comment #8
bengtan commentedThinking some more ... If we expand the solution ...
One could add two extra variables to each composite enabled node:
A. A variable indicating which layout set it was initialised from (if any)
B. Another variable/flag indicating whether the node's composite layout should be updated if the site administrator decides to bulk-update nodes with the layout set from (A).
The user can set or clear variable (B) as desired.
This approach would give the user flexibility to bulk-update layout sets if they wish to use it.
Problem now is ... it's quite a significant chunk of work. And I have a sneaking suspicion I'm going to have to create a new admin page or two because the layout sets functionality is outgrowing the current user interface of Composite Layout.
So, I'm not sure how simmoe feels about sponsoring something like this. I don't think I'd have the time to do this otherwise.
Comments welcome.
Comment #9
simmoe commentedIt all depends : )
My organisation is willing to pay the cost of the functionality i described @6. If you can set a reasonable price and scope for that task, we can begin today. Regarding the full implemenetation of your idea @8 I can understand if you feel the functionality @6 is only worth a patch - that'll do!
-unless ericinwisconsin wants to chip in of course?
Comment #10
ericinwisconsin commentedYour comments @7 are acceptable, bengtan. A simple reset switch works for me.
Well, "simple" to me, since I don't have a clue how to code it. :)
Thanks for your work on all this, bengtan.
Comment #11
bengtan commentedOkay, so it seems like simmoe would be happy to sponsor the 'reset' button from comment #6, and ericinwisconsin is satisfied with that as well.
Simmoe: I sent you a private email yesterday through your Drupal contact form at http://drupal.org/user/253709/contact. Do you want to have a look at that in your inbox?
Comment #12
bengtan commentedHi,
I've just committed this functionality into cvs (http://drupal.org/cvs?commit=275054).
I don't like doing dev snapshots, so instead, please download the attached 'dev' release and give it a try.
This only does the 'reset' functionality of #6.
Also, if you have many many nodes (ie. maybe 1000), and you do this reset, you may need a very large PHP memory_limit.
Thank you.
Comment #13
simmoe commentedThis looks good - thank you very much.
Best,
Simon
Comment #14
ericinwisconsin commentedThanks, Bengtan!
It did about 1/2 of the content type for me, but since I put in this feature request, my pages have increased to 640! That's a lot to ask of it and php, and my situation is unique, so I'm happy. Thank you.
Comment #15
bengtan commentedI believe this feature request is complete. It will be incorporated into the next release of Composite Layout, whenever that will be. In the meantime, please continue to use the snapshot from comment 12.
Thank you.
Comment #17
jeffamLooks like this patch was removed from a subsequent dev release. Out of curiosity: was the functionality not working correctly?
Regards,
Jeff
Comment #18
bengtan commentedHi,
No, I don't think it's been taken out. Possibly the checkbox on .../admin/content/node-type/nnn only appears if there are layout sets defined.
Comment #19
jeffamWeird. I couldn't find the code for the checkbox in the dev version I downloaded, and a scan of what appears to me to be the most recent CVS commit of the module seems to show the code being removed: http://drupalcode.org/viewvc/drupal/contributions/modules/composite/comp...
Maybe it was removed accidentally? Or am I looking at that CSV browser incorrectly?
Jeff
Comment #20
bengtan commentedOops, sorry. My mistake. I botched a patch from a previous issue and accidentally took out this and some other stuff. It's been fixed now. Please update from cvs.
References:
http://drupal.org/cvs?commit=408468
http://drupal.org/cvs?commit=408466
Comment #21
jeffamThanks for fixing this, and for the new dev release, too!