Developer forum

Forum » Development » Edit file in frontend with itempublisher

Edit file in frontend with itempublisher

Claus Kølbæk
Reply

Hey,

I made a comment in another post her: http://developer.dynamicweb.com/forum/development/how-to-upload-file-with-itemcreator.aspx?DWPagingPageNum=2

But since that post is already marked as answered I guess it would be more correct to create a new post - so here we go:)

When using the ItemCreator I can allow a user to upload an image or select one already uploaded in the same folder. I got this working fine!

However - using the ItemPublisher I want to allow the users to edit the already created items, and I have a problem getting that working with the file upload.

Few notes from my former post:

Used the above for the ItemCreator without any problem - but how would I go about making the same functionality in the ItemPublisher edit instead?

@GetValue("ItemPublisher:Edit.Form") Gives me all the text fields which changes fine on a "Save Changes" and it also list the image chosen in a dropdown - however nothing changes if you change it "Nothing selected".

If I then instead use the ItemPublisher:Edit:Form.Begin and ItemPublisher:Edit:Form.End it seems I only have a loop for the images in the dropdownlist and not a list of all fields as I would expect?

 

 


Replies

 
Mikkel Ricky
Reply
This post has been marked as an answer

In your item publisher edit template, you can use basically the same syntax as in the item creator template for creating a file upload, e.g.

@GetValue("ItemPublisher:Edit.Form.Begin")
<input type='file' name='FieldSystemName' accept='@GetValue("ItemCreator:Edit.Item.FieldSystemName.Extensions")'/>

@GetValue("ItemPublisher:Edit.Form")
<button type='submit'>Create</button>

@GetValue("ItemPublisher:Edit.Form.End")

As you correctly point out, template tags for all fields in the form are missing, but we're working on fixing that (Bug 15417).

Best regards,
Mikkel

Votes for this answer: 1

 

You must be logged in to post in the forum