Pretty new to EE, I am creating a site similar to desert island discs - but for crisps for a friend and as part of my uni assignment.
I'm using EE 2.5 and Safecracker 2.1. I have created the safecracker form based on this tutorial by Ryan White http://www.venveo.com/articles/view/understanding-safecracker-for-expressionengine.
Now the form works a charm from the front end. This is the setup:user_entries. Status group with status Pending created and assigned to the group. In members I have created an annonymous user and assigned access to the above channel to publish from front end (status still pending). This is all good.
I have a template group called entries and inside this I have the user_entries template where the form code resides. I also have a confirmation template to redirect users upo successful submission.
Now every time I test this, an entry is created - but in the pages section, which is fine. I can go there publish the page and all is good. What I can't figure out is how do I output all the new entries (after status change to Open) on the front end to another page called say Previous entries or similar.
Here is my code for the Safecracker form:
{embed="includes/html_head"}
<body>
<!-- Super Container for entire site -->
{embed="includes/masthead"}
<!-- Super Container -->
<div class="super-container full-width">
<!-- 960 Container -->
<div class="container">
<!-- CONTENT -->
<div class="eleven columns content">
<h2 class="title"><span>Submit your 8 choices!</span></h2>
<!--============SAFECRACKER STUFF GOES RIGHT HERE=============-->
{exp:safecracker
channel="user_entries"
return="entries/confirmation"
include_jquery="no"
logged_out_member_id="2"
rules:your_name="required"
rules:choice_number_1="required"
rules:choice_number_2="required"
rules:choice_number_3="required"
rules:choice_number_4="required"
rules:choice_number_5="required"
rules:choice_number_6="required"
rules:choice_number_7="required"
rules:choice_number_8="required"
rules:title="required"
}
<br class="clearfix" />
<hr />
<h3 class="feature">
<label><strong>First please tell us your name</strong></label>
<input type="text" class="text" name="your_name" value="{your_name}"/>
</h3>
<br class="clearfix" />
<hr />
<h3 class="feature">
<label><strong>Give your choice a memorable name</strong></label>
<input type="text" class="text" name="title" value="{title}"/>
</h3>
<fieldset class="five columns alpha aside">
<!--Choice one code-->
<h5>
<label><strong>Choice number 1</strong></label>
<input type="text" class="text" name="choice_number_1"/>
</h5>
<p>
<label>Choice 1 description</label>
<input type="text" class="text" name="choice_1_description"/>
</p>
<br />
<label>Choice 1 image</label>
<input type="file" class="" name="choice_1_image" />
</fieldset>
<!--====Choice twocode-->
<fieldset class="five columns omega aside">
<h5>
<label><strong>Choice number 2</strong></label>
<input type="text" class="text" name="choice_number_2"/>
</h5>
<p>
<label>Choice 2 description</label>
<input type="text" class="text" name="choice_2_description"/>
</p>
<br />
<label>Choice 2 image</label>
<input type="file" class="button green" name="choice_2_image"/>
</fieldset>
<!--===============Choice three code-->
<fieldset class="five columns alpha aside">
<h5>
<label><strong>Choice number 3</strong></label>
<input type="text" class="text" name="choice_number_3"/>
</h5>
<p>
<label>Choice 3 description</label>
<input type="text" class="text" name="choice_3_description"/>
</p>
<br />
<label>Choice 3 image</label>
<input type="file" class="button green" name="choice_3_image"/>
</fieldset>
<!--====Choice four code-->
<fieldset class="five columns omega aside">
<h5>
<label><strong>Choice number 4</strong></label>
<input type="text" class="text" name="choice_number_4"/>
</h5>
<p>
<label>Choice 4 description</label>
<input type="text" class="text" name="choice_4_description"/>
</p>
<br />
<label>Choice 4 image</label>
<input type="file" class="button green" name="choice_4_image"/>
</fieldset>
<!--===============Choice five code-->
<fieldset class="five columns alpha aside">
<h5>
<label><strong>Choice number 5</strong></label>
<input type="text" class="text" name="choice_number_5"/>
</h5>
<p>
<label>Choice 5 description</label>
<input type="text" class="text" name="choice_5_description"/>
</p>
<br />
<label>Choice 5 image</label>
<input type="file" class="button green" name="choice_5_image"/>
</fieldset>
<!--====Choice six code-->
<fieldset class="five columns omega aside">
<h5>
<label><strong>Choice number 6</strong></label>
<input type="text" class="text" name="choice_number_6"/>
</h5>
<p>
<label>Choice 6 description</label>
<input type="text" class="text" name="choice_6_description"/>
</p>
<br />
<label>Choice 6 image</label>
<input type="file" class="button green" name="choice_6_image"/>
</fieldset>
<!--===============Choice seven code-->
<fieldset class="five columns alpha aside">
<h5>
<label><strong>Choice number 7</strong></label>
<input type="text" class="text" name="choice_number_7"/>
</h5>
<p>
<label>Choice 7 description</label>
<input type="text" class="text" name="choice_7_description"/>
</p>
<br />
<label>Choice 7 image</label>
<input type="file" class="button green" name="choice_7_image"/>
</fieldset>
<!--====Choice eight code-->
<fieldset class="five columns omega aside">
<h5>
<label><strong>Choice number 8</strong></label>
<input type="text" class="text" name="choice_number_8"/>
</h5>
<p>
<label>Choice 8 description</label>
<input type="text" class="text" name="choice_8_description"/>
</p>
<br />
<label>Have an image for Choice 8 image?</label>
<input type="file" class="button green" name="choice_8_image"/>
</fieldset>
<!==============End the fieldsets here for the 8 choices-->
<br class="clearfix" />
<hr />
<p>
<input type="submit" class="button yellow" value="Submit your choices now!" />
</p>
<br class="clear" />
{/exp:safecracker}
<br class="clearfix" />
<hr />
</div>
<!-- /CONTENT -->
<!-- SIDEBAR -->
<div class="five columns sidebar">
{embed="includes/sidebar"} <!-- /SIDEBAR -->
</div>
<!-- /End 960 Container -->
</div>
<!-- /End Super Container -->
<!-- ============================================== -->
{footer}
<!-- End Document
================================================== -->
</body>
</html>
I shall be eternally grateful to any body who can help me with this issue. Please remember I'm new to EE so go gentle.
Many thanks
Ilir
{exp:channel:entries channel="user_entries" limit="8" status="pending|open"}
<h4 class="title">
<span>
This is the choice {title} made by {your_name} on {entry_date format="%F %d, %Y"}
</span>
</h4>
<ol>
<li class={first|second|third|fourth|fifth|sixth|seventh|last}>
<h5>{choice_number_1}</h5>
<p class="align-left">{choice_1_description}</p>
<img class="align-left" src="{choice_1_image}"/>
</li>
</ol>
{/exp:channel:entries}