One of my child post types has a repeatable image field. On the parent page I have a link to create that child post to upload images and it works as expected. I need to be able to have a link to edit that child post type too. I wanted to just change the add link to an edit link but I've read that I can only create the edit link while in the loop displaying the images from that child post. Is this correct?
Assuming the above is correct I tried to add the cred_form shortcode to my loop. The images display in a slider. I have 2 content templates that produce the slider:
This first content template is called from the parent page:
<div id="place-images-carousel" class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
[wpv-post-body view_template="place-image-slider"]
</div>
<!-- Controls -->
<a class="left carousel-control" href="#place-images-carousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#place-images-carousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
As you can see this calls the second content template with my loop:
[wpv-for-each field="wpcf-place-image" item='@place-to-place-image.child']
<div class="item">
[types field='place-image' title='%%TITLE%%' alt='%%ALT%%' align='center' height="300" resize='proportional' item='@place-to-place-image.child' class="d-block w-100"][/types]
<div class="place-image-edit-link">
[cred_form form='place-image-manager' post='@place-to-place-image.child']
</div>
</div>
[/wpv-for-each]
What I get is "Form type and post type do not match".
Is this because I've got a for-each going on rather than a wpv-loop? If so, how can I accomplish this with the wpv-loop instead?
I tried to change things up by calling the first content template from a view:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="place-container-slider"]
[toolset-edit-post-link content_template_slug="place-image-edit"]Edit Images[/toolset-edit-post-link]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-layout-end]
I get the link to work to take me to the edit form, but the slider no longer displays correctly.
For the view, I have the Content Selection set to the child post type with the images, and the Query Filter is set to "Select posts in a Places to Place Images relationship that are related to the Post where this View is shown."