I am building a portal where I always would like to show the weekly letter on top.
The standard mysite-view has this arranged but I would like to make sure that users who are registered does not move it around or remove it. Content with this "lock" applied should still be minimize and maximize-able but maybe that setting should not be saved, so whenever returning to their mysite the weekly-letter content is expanded by default.
This setting should only be set by a user with special permission, like admin.
What do you think is everything possible? Is anything stupid?
Comments
Comment #1
agentrickardThis is a perfectly reasonable request (it came up before http://drupal.org/node/135378) and is part of a next-gen feature set. See http://drupal.org/node/145423.
The easy way to do this right now is to hard-code the element that you want "locked" into the layout file(s) that your users can access. There should be obvious ways to do this if you read the API.
Comment #2
agentrickardLet's file this as a feature request against HEAD.
Question: would locked content count against a user's page element limit?
Comment #3
mounte commentedI think it should override the page-limit.
Comment #4
agentrickardOK, I've been thinking about this some more, and there are some complications.
1) Not all Layout files use the same regions, so how would we lock content across all Layouts? One answer is to only allow content locking in region 1 (typically the left-most region of the layout).
2) How may items can be locked?
3) What is the UI?
I'm not sure these questions are solvable. But here's what I did.
In HEAD, there is now a function
mysite_display($type, $type_id, $uid = 0, $format = 'default'). It allows you to pull a MySite content element into another theme, block, or panel.It may be that admins who want to lock site content need to hard code these calls into their layout files. I'll need to do some testing to see how that interacts with the drag-and-drop code.
For example, to add the data for term 2 to all user pages, so that it cannot be removed, call:
Comment #5
mounte commentedI have been overwhelmed with work for some time now, and it is not over yet.
Supposing that the admin has locked the layout to just one possible item I was thinking if it would be possible to create a "mysite-profile" which is a "default" profile with all content locked. When a user loads his mysite the "default" profile is loaded first, then the other content is added.
I have NOT been thinking so much about this, it might be totaly crazy ... what do you think?
Comment #6
agentrickardThat's basically how the 'default content' works now -- except that users can change the content after logging in.
The problem I see is how to handle that default 'locked' content across multiple layouts. If we have locked content in the right rail of a two column layout, where does it go for a user that has a single-column layout or a three-column layout selected?
One option I'm considering is making a 'hidden' layout region that can only be edited by the site administrator. This would be a 'region zero' that could be applied to all layout files.
Items within region zero could not be edited by the end user.
This might be a good compromise solution to the problem of flexible layouts.
Comment #7
agentrickardI have written a fix for this and documented it. From the README.
Will commit to HEAD later today.
This feature requires that you run Drupal's update script.
Comment #8
(not verified) commented