First steps with Form Helper…
Posted: 07 April 2008 11:08 PM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2008-04-02

Hi,

I am new to ExpressionEngine but I become slowly better. Since yesterday I started trying the Form Helper plugin. So I started with a simple Single Entry form and used the Form Helper Tags with it. My form looks like this:

{exp:form_helper:member_is_author author_id="1"}
{if member_not_author}
Sorry
Only the author of this entry is allowed to edit it.
{/if}

{exp
:weblog:entry_form weblog="myblog" return="template/index"}

<input type="hidden" name="entry_id" value="{entry_id}" />
<
input type="hidden" name="title" value="{title}" />

<
p>Street<br />
<
input type="text" name="{exp:form_helper:field_grabber field_name='street'}" value="{street}" />
<
input type="hidden" name="{exp:form_helper:field_grabber field_name='street' which='format'}" value="br" />

<
p>ZIP<br />
<
input type="text" name="{exp:form_helper:field_grabber field_name='zip'}" value="{zip}" />
<
input type="hidden" name="{exp:form_helper:field_grabber field_name='zip' which='format'}" value="br" />

<
p>City<br />
<
input type="text" name="{exp:form_helper:field_grabber field_name='city'}" value="{city}" />
<
input type="hidden" name="{exp:form_helper:field_grabber field_name='city' which='format'}" value="br" />

<
p>Comment<br />
<
textarea name="{exp:form_helper:field_grabber field_name='body'}"  rows="10" cols="50" />{exp:form_helper:field_parser}{body}{/exp:form_helper:field_parser}</textarea></td>
<
input type="hidden" name="{exp:form_helper:field_grabber field_name='body' which='format'}" value="br" />
</
tr>

<
input type="submit" name="submit" value="Submit" />

{/exp:weblog:entry_form}
{
/exp:form_helper:member_is_author}

The result can you see on the attached pic. And here are my questions:

1. Why appear the values in the forms?
2. I don´t need the title and date fields. But I can´s save the form in the front-end without the title field. Can I disable it somehow?

Thanks a lot in advance for your hints.

---------------

Some additional informations: What do I want?

I want that members can login to their member profile. There they will find a new area (form) where they can enter informations and rate it by the Rating Module. After saving it will be published to the public area which can be customized by me - so that I can show some of the rated entries by specific criteria.

----------------

Thanks and regards,
Lars

P.S. Sorry for the broken English.

Image Attachments
screenshot188.png
Profile
 
 
Posted: 08 April 2008 06:57 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2179
Joined  2006-10-18
Lindstrom - 07 April 2008 11:08 PM

1. Why appear the values in the forms?

You’ll need to wrap the weblog:entries loop around your code smile

Lindstrom - 07 April 2008 11:08 PM

2. I don´t need the title and date fields. But I can´s save the form in the front-end without the title field. Can I disable it somehow?

They’re required, but you can set them as hidden if you don’t want them to show for editing smile

<input name="entry_date" type="hidden" value="{entry_date format='%Y-%m-%d %g:%i %A'}" maxlength="23" />
<
input name="title" type="hidden" value="{title}" />

 Signature 
Profile
 
 
Posted: 08 April 2008 07:20 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  2
Joined  2008-04-02

Thanks a lot. Now it works.

Another question: When entered some data in this form it appears on the public weblog. Ok, but when I go to the form again I see as many forms as saved data-sets.
But I want that someone can enter a dataset and even can see it in his member profile, but it shouldn´t be allowed to edit these datasets once they are saved. Assuming that I will add the Rating module later and users can give some ratings in the datsets by using this form they would be able to change the rating later - which shouldn´t be allowed because it fakes the result.

How can I prevent editing? Everytime the user go to this form in his member profile he will find a blank form where he can add a new dataset. The already entered datasets will be listed without access to them.

Thanks and regards,
Lars

Profile
 
 
Posted: 08 April 2008 12:17 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2179
Joined  2006-10-18

Lindstrom,

You mean, it’s showing the edit form multiple times on that page?
You’ll need to make sure you’re viewing the edit form template with an Entry ID in the URL:

http://www.yoursite.com/template_group/template/67 (entry ID)

Secondly, as for the making sure the form does not show for others…
The SAEF Entry Form (which is used in FormHelper… just manipulated), will not show to anyone who does not have sufficient privilages for their member group.

Additionally, you can set the Template the code is on to be visable by Admin’s (or any other group) ONLY with the “Access” settings for that template.
You can also use a conditional around your code, like this:

{if logged_in_group_id == "1"}{/if}

Or, to allow multiple groups:

{if logged_in_group_id == "1" || logged_in_group_id == "5" || logged_in_group_id == "6"}{/if}

 Signature 
Profile