Hey there hope you guys doing good!
Let´s say i have an CPT. And on this single template i want to build in a bootstrap button which triggers a modal.
In this modal a relation-form is inside.
Ok everything is working fine: the button triggers the modal and the form is working. my solution was to use a content template. but i can´t put in visibility queries like in a view.
I want to show this Button in the single template only when the current user is the author of the cpt (like in views but views or only loops).
hope you can help.
cheers
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Stephen,
What you can do is to use our conditional shortcode to do this.
This should get you your desired results.
[wpv-conditional if="( '[wpv-current-user]' eq '[wpv-post-author]' )"]
Button code goes here
[/wpv-conditional]
Please try this and let me know if it helps.
Thanks,
Shane
hey shane, thanks for your reply.
the content template is not saving. an error appears.
here is the code from the template:
[wpv-conditional if="( '[wpv-current-user]' eq '[wpv-post-author]' )"]
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal">Einrichtungen verknüpfen</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Einrichtungen verbinden</h4>
</div>
<div class="modal-body">
<p>Wähle aus, für welche deiner Einrichtungen dieser Job gilt.</p>
<div>
[cred-relationship-form form='jobs-einrichtungen' parent_item='$current']
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">X</button>
</div>
</div>
</div>
</div>
[/wpv-conditional]
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Steffen,
Could you let me know what the error you are getting is ?
Thanks,
Shane
Transleted to english:
„Not able to save the content template“
Hey Shane,
thanks for your help. Tried it today with fresh cache from the browser.
It is working great.
Thanks a lot for your help!
I have to say Toolset is really great but your support is absolutly awesome!
cheers