Display custom field based on user role
Posted: 14 October 2008 06:38 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  121
Joined  08-05-2005

I’d like to create some custom fields for entries. My user group “editors” will be able to enter/set the data for these custom fields. My user group “developers” (lower user level) shouldn’t be able to enter/set/write data into these fields. Also, I might want developers to see some of these “un-writeable fields” and some of them be invisible to them.

Is this possible with EE?

 Signature 

—-
Carlos A. Camacho
Editor-in-Chief
iDevGames.com | iDevApps.com | uDevGames.com

Profile
 
 
Posted: 15 October 2008 02:05 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12381
Joined  04-29-2002

Carlos, yes, you could do this. But it would be easiest to do so with the SAEF (Stand Alone Entry Form). You’d have to do a SAEditF (Stand Alone Edit Form) since you’d want to allow them to edit their entries.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 15 October 2008 06:52 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  121
Joined  08-05-2005

Sue, thanks for replying to my question.

Could you give me a link or two to get me started?

I haven’t used EE since 1.4 and SAEF is alien to me. LOL

 Signature 

—-
Carlos A. Camacho
Editor-in-Chief
iDevGames.com | iDevApps.com | uDevGames.com

Profile
 
 
Posted: 24 October 2008 10:15 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
RankRank
Total Posts:  121
Joined  08-05-2005

I setup a Stand-Alone Entry Form at http://www.udevgames.com/index.php/submit/.

I have it displaying the title and a custom field called description

<p>Game Title<br />
<
input type="text" name="title" id="title" value="{title}" size="50" maxlength="100"></p>

Description:<br />
<
textarea id="{description}" name="{description}" dir="{text_direction}" cols="50" rows="{rows}"></textarea

This entry has 24 or so fields. At the moment, I am only using two on the form. Does that create an issue?

Because when I click submit, I get “Disallowed Key Characters”

What happens for any custom field or regular field that I don’t include in my form? Do they just remain NULL with no data in them?

I’m pretty lost.

:(

 Signature 

—-
Carlos A. Camacho
Editor-in-Chief
iDevGames.com | iDevApps.com | uDevGames.com

Profile
 
 
Posted: 24 October 2008 10:34 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  121
Joined  08-05-2005

Well, I wanted to display a custom field one at a time, but couldn’t get it to work as stated above. So I used the generic method of

{exp:weblog:entry_form weblog="udg_2001" return="site/index" preview="site/submit" status="pending" show_fields="title|description|genre|requirements|download_one|download_two|download_three"} {preview} <h1>{title}</h1> {display_custom_fields} {/preview} <table> <tr> <td> <p>Title<br /> <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100"></p> <p>URL Title<br /> <input type="text" name="url_title" id='url_title' value="{url_title}" maxlength="75" size="50" /></p> {formatting_buttons} {custom_fields} {if required}* {/if}{field_label}<br /> {field_instructions} {if textarea} <textarea id="{field_name}" name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}">{field_data}</textarea> {/if} {if textinput} <input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50"> {/if} {if pulldown} <select id="{field_name}" name="{field_name}"> {options}<option value="{option_value}"{selected}>{option_name}</option>{/options} </select> {/if} {if date} <input type="text" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50"> {/if} {if relationship} <select id="{field_name}" name="{field_name}"> {options}<option value="{option_value}"{selected}>{option_name}</option>{/options} </select> {/if} {/custom_fields} </p> <p> <input type="submit" name="submit" value="Submit" /> <input type="submit" name="preview" value="Preview" /> </p> </td> </tr> </table> {/exp:weblog:entry_form}


Works, but seems wasteful.

 Signature 

—-
Carlos A. Camacho
Editor-in-Chief
iDevGames.com | iDevApps.com | uDevGames.com

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64912 Total Logged-in Users: 27
Total Topics: 81864 Total Anonymous Users: 18
Total Replies: 440101 Total Guests: 184
Total Posts: 521965    
Members ( View Memberlist )
Newest Members:  bjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcfthenetmonkeybenekwhobutsb