I've now added Image as a second Asset Type to Create (in addition to Standard Page), and am finding that by doing that, the form behaves oddly, even without customisation or setting up Required Attributes.
The Asset Builder Page manual says to add as many asset types as you like but doesn't explain how the form will work when more than one asset type is chosen, not that I've been able to find anyway. When more than one asset is chosen for the Asset Builder to create, on the frontend at the top of the page there are links to types of assets of assets to be created, but only the form for the first asset (in my case the Standard Page) is displayed by default. To get the form for the second asset to display you have to click on the link to it from the top of the page, and only then do both forms appear. The weirdest thing is that the metadata fields for the Standard Page form then become locked down and unable to be filled in, even after unticking Use Default. Has anyone had any experience with using the Asset Builder Page to create more than one asset that they'd be willing to share with me?
Just to add to my previous post, if I remove the metadata schema altogether and go the the frontend, and bring up both asset forms and fill in editable fields, upload an image and submit, only the image is created, not the Standard page.
Just to add to my previous post, if I remove the metadata schema altogether and go the the frontend, and bring up both asset forms and fill in editable fields, upload an image and submit, only the image is created, not the Standard page.
I would build two Asset Builders rather than trying to configure multiple assets in one. It is easier that way, trust me.
thanks for your suggestion, Nic, but if I'm wanting users to be able to create a standard page with an image in it, how would that work using 2 Asset Builders?
thanks for your suggestion, Nic, but if I'm wanting users to be able to create a standard page with an image in it, how would that work using 2 Asset Builders?
Well, allowing an asset builder to create two different asset types won't solve this issue either.
You need to setup an asset builder to build standard pages, then on the Thank You screen, you need to direct the user to edit that page. Once they are editing this page, then you can have them use the WYSIWYG editor to create a new image file. This is the easiest way.
The thing is I don't want these users to have to be logged into the system, which I understand is the only way that you can edit an existing asset, no?
The thing is I don't want these users to have to be logged into the system, which I understand is the only way that you can edit an existing asset, no?
Using a paint layout & 2 asset builders might be an option, depending on how exactly you need this to work.
Asset builder #1 creates the standard page and applies a paint layout with an asset listing that will add any images under standard page to the page.
Asset builder #2 is linked from the thankyou page - use the link to pass through the assetid of the standard page you just created to the second asset builder form. Asset builder #2 then creates images underneath the standard page which will automatically be added to the page by the paint layout.
This is where I'm now at with this little project... I have an Asset Builder to create a Standard Page, and a second Asset Builder to create an Image.
When the Asset Builder for the Standard Page is submitted, a Standard Page is created at that point in the designated location but instead of a success message you get taken to the Asset Builder for the Image because I've nested the Asset Builder for the Image in the Created asset for the Asset Builder for the Standard Page, which is all good so far (at least I think so!).
I can then upload an image and submit it, but the image doesn't get created, and instead I get taken back to the Asset Builder for the Standard Page. The create location for the Image is the same as for the Standard Page, which is obviously not useful for what I want to do but I don't know how to "pass through the assetid of the standard page you just created to the second asset builder form" as you suggested, JP, which I would presumably then be able to reference somehow. But I would have thought that it would create an image anyway.
So the main problem I'm left with is getting the image created as a child of the Standard Page that is created, because as you said, JP, applying a Paint Layout to the Standard Page can insert the image in the page no problem. I'm guessing that it's somewhere in the Additional Create Locations that I have to set this up, any suggestions?
So the main problem I'm left with is getting the image created as a child of the Standard Page that is created, because as you said, JP, applying a Paint Layout to the Standard Page can insert the image in the page no problem. I'm guessing that it's somewhere in the Additional Create Locations that I have to set this up, any suggestions?
Like I said, this part gets tricky, and I don't think there are any manuals about there that describe this process.
Nesting the second asset builder is not the key here, you need to remove that. Here is the process:
- Standard Page asset builder creates standard page.
- On Created bodycopy, you need to have a new link, which directs the user to the second, Image asset builder, and passes along the ID of the newly created Standard Page so that it can be used as the create location.
- Use something like:
<a href="%globals_asset_url:123%?imageBuilder=%created_assetid%">Add an image</a>
- 123 is the ID of the Image Asset Builder
- On the Image asset builder, configure your Create Locations. Look at the Additional Create Locations section and setup a Parameter for Additional Create Locations, and GET Variable Name. Submit the page and then set the name to imageBuilder.
- Then set the permitted tree locations and permitted asset types.
That should be what you need to get this working. Now for the paint layout portion, that is also tricky. What you have to do is have a paint layout that is applied to your standard page assets. Edit the paint layout type format for Standard Page, then nest in an Asset Listing which is looking 1 level down for image assets. Also make sure to use the %asset_contents% keyword in the type format as well or the rest of your Standard Page content won't show.
thanks all, your advice in particular, Nic and JP, has really advanced this project.
I have it set up now so that an Image file can optionally be created in addition to the Standard Page, which is working fine, the image gets created as a child of the Standard Page.
The Standard Pages are using a Paint Layout which works well for displaying the Name and Metadata fields for each Standard Page, and the Paint Layout is nesting an Asset Listing, with the Root Node of this Asset Listing set as the folder where the Standard Pages are created.
The remaining problem I have is that if I restrict the Asset Listing to look at Direct Links Only, no image appears in the Standard Pages that have had an image added, whereas if I turn off Direct Links Only, then all images from any Standard Pages that have an Image as a child appear in every Standard Page. So it's like the system is applying the Direct Links Only command to the Root Node folder rather than to the Standard Page, because when I turn off Direct Links Only, all image files under the root folder appear in the Asset listing for every Standard Page.
In your asset listing, you need to configure the Dynamic Parameters section. Choose "Replacement Root node for the listing" then for Source, use "Current Asset".
This will allow the asset listing to use the currently painted asset as the root node. Just make sure that you don't change the Root Node setting for the asset listing, since it needs to be at a high level like you have set it.
Nic, I saw that you had a solution for using an Asset Builder to allow for multiple file uploads (http://forums.squizsuite.net/index.php?showtopic=6645) which I'd like to apply to my second Asset Builder for creating images: I haven't had much luck applying it though. Any suggestions on how to apply your solution in my case where I'm allowing users to create more than one asset type? The method I've been trying so far includes creating a second Additional Create Location called "location", am I on the right track?
Another issue I've found is that if you try to submit a form with errors or leave some required fields blank, the metadata fields that have been filled in get stripped out, so the user is forced to fill them in again. Is there a solution for this?
Nic, I saw that you had a solution for using an Asset Builder to allow for multiple file uploads (http://forums.squizsuite.net/index.php?showtopic=6645) which I'd like to apply to my second Asset Builder for creating images: I haven't had much luck applying it though. Any suggestions on how to apply your solution in my case where I'm allowing users to create more than one asset type? The method I've been trying so far includes creating a second Additional Create Location called "location", am I on the right track?
Yeah, the setup for that is a little tricky. Would be really hard for me to troubleshoot without actually seeing how you are setting it up and what issues you are having.
Another issue I've found is that if you try to submit a form with errors or leave some required fields blank, the metadata fields that have been filled in get stripped out, so the user is forced to fill them in again. Is there a solution for this?
Yeah, this has always been an issue. I submitted it as a bug, but it was marked as Not a bug. So I guess something Squiz didn't think was an issue.
Another issue I've found is that if you try to submit a form with errors or leave some required fields blank, the metadata fields that have been filled in get stripped out, so the user is forced to fill them in again. Is there a solution for this?
if you copy the html for the field out of the page and use that in the bodycopy instead of the field keyword and add value="%globals_post_fieldname%" to it that should refill it even if there's an error
if you copy the html for the field out of the page and use that in the bodycopy instead of the field keyword and add value="%globals_post_fieldname%" to it that should refill it even if there's an error