[DUG-TO] A problem to contemplate

Andre Molnar andre at becircle.com
Fri Apr 17 01:12:01 EDT 2009


Hey folks,

Just catching up on local Drupal reading.

As discussed, certain fields displayed in node forms are controlled via
Drupal's core permission system.  Each role on the site will have
different privileges to do different things, particularly when creating
/editing content.

In the case of CCK fields and permissions to access those fields at node
create/edit time - this is now part of CCK as of version 2.x in Drupal
6.  It is a sub-module called content_permissions module.

As for altering the display of forms:

As suggested - see what you can accomplish via CSS.  You may be surprised.

The next level would be to theme individual forms.  Do a google search
for theming forms.  Jamon (local to Toronto) has an article on the topic
here: http://agaricdesign.com/note/how-theme-drupal-form

The final level (if all else fails) is to get elbow deep in altering the
form before it ever gets rendered.  And that requires looking into
hook_form_alter.  But, in the case of node forms it rarely comes to that.

Hope that helps.

andre
Alex De Winne wrote:
> I'd probably approach it with CSS before altering html if all you need to do
> is alter layout. 
> 
> If you need to alter the HTML, hook_form_alter function (
> http://api.drupal.org/api/function/hook_form_alter/6) in template.php or in
> a custom module would do it. Hook_form_alter function is pretty well
> documented in the Pro Drupal Development book. If you don't have it I'd
> recommend getting it. Otherwise, there's lots of posting on the drupal forum
> on how to use it. It looks a bit daunting at first, but it's not too bad :)
> 
> 
> ALEX DE WINNE 
> THEREFORE INTERACTIVE INC.
> T: 905 918 2690  |  F: 416 913 1953  |  W: THEREFORE.CA
> INTERACTIVE  |  EMARKETING  |  WEB HOSTING
> 
> This message is intended for the addressees only and may contain
> confidential or privileged information. Any use of this information
> by persons other than addressees is prohibited. If you have received
> this message in error, please reply to the sender and delete or
> destroy all copies
> 
> 
> On 14/04/09 5:54 PM, "Evan Leibovitch" <evan at telly.org> wrote:
> 
>> Alex De Winne wrote:
>>> In general, many of the "standard" form elements in a 'node add page'
>>> visibility is dictated by the permissions granted to the user who is
>>> creating the node. So I'd recommend you have a look at creating roles for
>>> these types of users and then assigning only the permissions required for
>>> them to do what they need to do on the site and see how many field elements
>>> are left in the content types at that point.
>>>
>>> To remove additional fields, I believe would require custom module coding
>>> with overrides, but I could be wrong.
>>>   
>> Thanks!
>>
>> Actually, I was so used to using the system in admin mode that I had to
>> logout and log back in under a test user (with only "authenticated"
>> privs) to see this in action. So I'm generally fine there.
>>
>> Now... what about exploiting all of the unused real estate on the data
>> entry screen?
>>
>> Instead of
>>
>> First Name: ______________
>>
>> Middle:   _______________
>>
>> Last Name: ________________
>>
>>
>> I'd like to do
>>
>> Name:
>> First              Middle              Last
>> _________        _____________    _____________
>>
>>
>>
>> (This may not look good in fixed width font but I hope you understand
>> what I mean.)
>> I looked into doing custom tpl.php files but that seems to work for
>> display only.
>>
>> I think I can have the suffieient control I want over output using
>> Views. It's the input forms I'd like some more control over.
>> The module "form panel" claims to "Easily Rearrange Input Form Elements"
>> and gives some examples of exactly what I'd like to do. But then
>> "easily" becomes a relative term as the module seems to require both
>> theme and programming modifications -- and it's documentation assumes
>> the implementor knows the existing secret developers' handshakes.
>>
>> Any other ideas or modules that might give similar results?
>>
>> - Evan
>>
>> _______________________________________________
>> DUG-TO mailing list
>> DUG-TO at lists.openject.com
>> http://lists.openject.com/listinfo/dug-to
> 
> 
> 
> 
> 
> 
> _______________________________________________
> DUG-TO mailing list
> DUG-TO at lists.openject.com
> http://lists.openject.com/listinfo/dug-to



More information about the DUG-TO mailing list