Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hi Everyone.

I've created a databound form that submits data into a cloneable template. The templates placed within a folder called articles. (members/articles/index.php). Within submitting the form its saving the members details. custom field called author to fetch the users title and linkprofile to fetch the users id.

Now on the index.php page within the articles this is showing the submitted databound. I want the user only to edit this, so a link within the template to edit or delete the submitted item.

they will then be listed within the pages tag showing the user only posts, so beside the list of posts i can then add in the edit or delete function.

I've got confused over this function and the best way to-do so.

Thanks for your support.
bump
Thanks for the bump :) Needed that as this thread had dropped off my radar.

Coming to the issue -
If I remember it correctly, you already have the page working that displays only the articles submitted by the currently logged-in user. Right?

So now would you want to show the edit and delete link alongside each listed article on the page mentioned above?

Please let me know.
Hi KK,

Not a problem missing this post. That's right. I've looked through most of the posts to delete or edit posts submitted by the user but cant find anything.

On the submitted article by the user i want to display a edit function or a delete function, as buttons or text links.

Thank you :D
Simon,

Within the <cms:pages> block that generates the page, put:
Code: Select all
<cms:if author==member >
   <!-- link goes here -->
   <!-- or embed form directly on page -->
</cms:if>
Use a <cms:dump_all /> tag to figure out the exact variables that need to be compared.
--

As far as creating the edit form, it works the same as any data-bound form except that you use mode='edit' instead of mode='create'.
Code: Select all
<cms:form
    masterpage=k_template_name
    page_id=k_page_id
    mode='edit'
    enctype='multipart/form-data'
    method='post'
    anchor='0' >

Also notice the page_id parameter that tells which page to edit. User-edited data-bound forms are less well-documented than user-created ones. I forget where I picked up this boilerplate code.

I’m not sure there is any way for a front-end user to delete a page, though. Maybe you could allow them to "unpublish" it, and/or send a request to the admin to remove it.

Hope there’s something helpful for you here.
Tim
@simon,

Can you please take a look at the following?
viewtopic.php?p=16692#p16692

What you are trying to create is kind of a mini admin-panel on the front-end. Yes, of course, it can be done. It'll only require keeping some security guidelines and a few more points in mind.

As I mentioned in the reply, I'll try and get a tutorial done that covers all these functions.
Could you please stay put for some more time till that is ready?

Thanks.
Thanks for both of your replys.

KK i will wait till a full documentation has been released however i'll work with tims reply for the mean time.
KK wrote: @simon,

Can you please take a look at the following?
viewtopic.php?p=16692#p16692

What you are trying to create is kind of a mini admin-panel on the front-end. Yes, of course, it can be done. It'll only require keeping some security guidelines and a few more points in mind.

As I mentioned in the reply, I'll try and get a tutorial done that covers all these functions.
Could you please stay put for some more time till that is ready?

Thanks.


Is it possible to make a DELETE button on front end today? Only thing i need to complete TODO list. ?
Is it possible to make a DELETE button on front end today?
Sure. The advanced tutorial I kept mentioning in my older posts finally did get to see the light of day -
http://www.couchcms.com/docs/advanced-t ... index.html

Take a look at how the 'Delete view' has been implemented there.

Hope it helps.
9 posts Page 1 of 1