Skip Navigation

[Resolved] View with relationship

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 36 replies, has 3 voices.

Last updated by avansisI-2 3 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1855543
Captura de pantalla 2020-11-24 a las 16.59.26.png

I have created a view to list all the 'coupon' custom types. But in the column 'trade' I don't get the trade assigned by relation, and I don't know what I'm doing wrong.

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<table width="100%">
		<thead>
			<tr>
				<th>[wpv-heading name="types-field-nombre_campana"]Nombre de la campaña[/wpv-heading]</th>
				<th>[wpv-heading name="types-field-referencia-del-bono"]Referencia del bono[/wpv-heading]</th>
				<th>[wpv-heading name="types-field-fecha-de-creacion-del-bono"]Fecha de creación del bono[/wpv-heading]</th>
				<th>[wpv-heading name="post-taxonomy"]Estados[/wpv-heading]</th>
				<th>[wpv-heading name="types-field-logo"]Comprobante uso[/wpv-heading]</th>
				<th>[wpv-heading name="post-taxonomy"]Comercios[/wpv-heading]</th>
			</tr>
		</thead>
		<tbody class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<tr>
				[wpv-post-body view_template="loop-item-in-listado-bonos-administrador"]
			</tr>
		</wpv-loop>
		</tbody>
	</table>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

add an image

#1855875

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

I'm assuming that there is a child view that is to be listing out the information for the trade column.

Is there a filter on this view to select out the child post?

Can you allow me to have admin access to the site ?

Thanks,
Shane

#1855913

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

On your table i'm not seeing any column called "trade".

Can you let me know where can I see this column?

Thanks,
Shane

#1855915
Captura de pantalla 2020-11-24 a las 22.17.23.png

Is the last column

#1856793

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I see the issue now.

In order to get this to work you will need to create a child view to list out the posts in the relationship.

I've gone ahead and set this up for you. All you need to do now is setup the relationships for Bonos and Comercios.

Thanks,
Shane

#1856873

Thanks Shane, I've already seen that it's working.

is there any chance that you can assign that shop from a front view?

#1857013

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I'm not sure what you mean.

Can you provide a bit more clarity on what exactly you want me to do ?

Thanks,
Shane

#1857031
Captura de pantalla 2020-11-25 a las 18.52.28.jpg

Yes!

I have a view and I want there to be fields that I can modify.

#1857091

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

So you want a frontend form on the listing so that you can modify the fields of the posts?

Thanks,
Shane

#1857099

Yes! this i need.

#1857103

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Ok all you need to do is to create an edit post form.

Then add that edit form to the child view that i've created. This should allow you to achieve your goal.

Once you've done this please let me know the results.

Thanks,
Shane

#1857107

I don't know why when I create the attach file field it loses the voucher reference. Also, the submission file should only appear when there are no attachments yet.

/listado-bonos-administrador/

#1857119

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Based on what I see you're doing is that you've created a form to make a new post. What you need to do is to set the form here to edit the existing post.
hidden link

So instead selecting "Add New Content" you will select "Edit Existing content".

Now in order to only show the form when the field is empty you will need to edit the view here.
hidden link

Use the conditional button to setup a conditional for the image field to check if it is not empty and display the image and if it is empty you display the form.

Thanks,
Shane

#1857133
Captura de pantalla 2020-11-25 a las 22.14.46.png

the conditional I do in

Loop item in Listing of manager coupons?

[wpv-conditional if="( $(wpcf-comprobante) eq '[types field='comprobante'][/types]' )"][/wpv-conditional]
[wpv-conditional if="( $(wpcf-comprobante) ne '[cred_form form="adjunto-bonos"]' )" evaluate="false"]
#1857147

I try with this but doesnt work

<td>[types field='nombre_campana' separator=', ' item='@campana-bonos-bono.parent'][/types]</td>
<td>[types field="referencia-del-bono"][/types]</td>
<td>[types field="fecha-de-creacion-del-bono"][/types]</td>
<td>[wpv-post-taxonomy type="estado"]</td>
<td>[types field='comprobante'][/types][cred_form form="adjunto-bonos"]</td>
<td>[wpv-view name="child-view"]</td>

[wpv-conditional if="( $(wpcf-comprobante) eq '1') gte 'empty'][/wpv-conditional]
[wpv-conditional if="( $(wpcf-comprobante) ne '1') gte [cred_form form="adjunto-bonos"]][/wpv-conditional]


This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.