Asset builder page to add an attachment


(Clementoke) #1

Hi all, 

I've created an asset builder page to allow staff create standard pages on the website. I want to give them the option of then uploading a file underneath the created asset as a sort of attachment.

I'm trying to use the dynamic location to pass the created asset id of the parent asset to the file but not having much success. I tried using POST variable asset_id then passing the %created_asset_id% in the link to the Asset Builder page for the attachment.

Didn't work.

Any simple and elegant solutions to this?

Cheers,

Clement dynamiclocation.JPG (26.2 KB)


(Nic Hubbard) #2

Yes, here is how you do it:

 

  1. Create two asset builders
  2. Configure the first asset builder to create the standard page
  3. On the "Created" bodycopy of that asset builder, create a link to the second asset builder that includes the created ID as a query string. E.g. <a href="%globals_asset_url:1234%?created=%created_assetid%">Upload an image for this page</a>
  4. Then configure the Additional Create Locations for the second asset builder. You will need to configure a GET Variable Name that is set to "created". Or, whatever key you used in the query string.
  5. Next configure your second asset builder to create the image.

Now you can easily go from builder one, to builder two to create the image.

 

Advanced:

 

If you want to get a little more fancy, you can use the second asset builder as an iFrame within the created bodycopy of the first asset builder. You can build it in a way that it looks just like a button that says "Upload". Then add some onclick and onchange handlers and you will have a nice and easy uploader right on that screen.

 

Screen%20Shot%202015-02-10%20at%208.57.5


(Clementoke) #3

AWESOME!! As ever.


(Clementoke) #4

Nope, I must have done something wrong. Still getting the "Unable to determine where to create this PDF File [CMS0033]" error. 

Attach a file

Do i need to add a fixed location too?


(Nic Hubbard) #5

Nope, I must have done something wrong. Still getting the "Unable to determine where to create this PDF File [CMS0033]" error. 

Attach a file

Do i need to add a fixed location too?

 

No, you don't need that. 

 

Are you sure, on the second asset builder that you setup an Additional Create Location with GET, using the var name of created?


(Clementoke) #6

 Yupdynamiclocation.JPG


(Nic Hubbard) #7

 Yupdynamiclocation.JPG

 

And you configured the rest of the options in Additional Create Locations?


(Clementoke) #8

Ah...


(Clementoke) #9

Thanks Nic,

That worked as it should. Now I haev to try out some fancy stuff like mulitple uploads and returning to the parent item.


(Nic Hubbard) #10

Thanks Nic,

That worked as it should. Now I haev to try out some fancy stuff like mulitple uploads and returning to the parent item.

 

That should be pretty easy as well.