Skip Navigation

[Resolved] cred_show_group don't work inside a table cell

This support ticket is created 5 years 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.

Our next available supporter will start replying to tickets in about 4.12 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by tipinoncomuni 5 years ago.

Assisted by: Waqar.

Author
Posts
#1393899

I am trying to conditionally display a field value and a text inside a table cell in a cred form:
This DON'T WORK
<tr>
<th class="tg-au6fr">ACTION ID</th>
<th class="tg-ioj1l">[types field='actionid'][/types][cred_show_group if="( $(pactionid) ne 'pippo' )" mode="none"] (derived from hidden link">xx[types field='pactionid'][/types])[/cred_show_group]
</th>
</tr>

Also This DON'T WORK
<tr>
<th class="tg-au6fr">ACTION ID</th>
<th class="tg-ioj1l">[types field='actionid'][/types]</th>
</tr>
<tr>
<th class="tg-au6fr">PARENT</th>
<th class="tg-ioj1l">[cred_show_group if="( $(pactionid) ne 'pippo' )" mode="none"] (derived from hidden link">xx[types field='pactionid'][/types])[/cred_show_group]</th>
</tr>

THIS WORKS!:
[cred_show_group if="( $(pactionid) ne 'pippo' )" mode="none"]
<tr>
<th class="tg-au6fr">PARENT</th>
<th class="tg-ioj1l">(derived from hidden link">xx[types field='pactionid'][/types])</th>
</tr>
[/cred_show_group]

At the same time, wpv-conditional doesn't seem to work inside a cred form
hidden link

I expected to see: the text inside the shortcode

Instead, I got:
- nothing when i use cred_showgroup (data is present in HTML but is marked as "display:none")
- the shortcode code when i use wpv-conditional

#1394249

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests on my website and the "cred_show_group" shortcode seems to work as expected from inside the "td" and "th" tags.

Since the "cred_show_group" shortcode inserts a "div" tag around the fields wrapped in the conditional block, it is important that it is used in a way that form's HTML remains valid.

Note: the hidden "div" tag containers that you see in the form are expected and that's how the "cred_show_group" shortcode shows/hides the fields, based on the form's input.

Also, the "wpv-conditional" shortcode also works from inside the form, but it is important to understand the scope of the current item. For example, if you'll use "wpv-post-id" shortcode, inside the form to add new post, it will return the ID of the current page, where the form is inserted and not the ID of the post that will be created.

You're welcome to share temporary admin login details along with the link to the page with forms, in case the issues still persist.

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1395387

Thank you for sharing the admin access.

During troubleshooting, I noticed that the shortcode "wpv-conditional" was showing as it is because of longer dash character.

Instead of "-" the opening and closing of that shortcode is using "–". Please replace both instances of "wpv–conditional" with "wpv-conditional".

Also, the enclosed bracket is started outside the link tag, so it should end outside it too.

Incorrect:


[wpv–conditional if="( $(pactionid) eq 'pippo' )"](derived from <a href="<em><u>hidden link</u></em>">xx[types field='pactionid'][/types])</a>[/wpv–conditional]

Correct:


[wpv–conditional if="( $(pactionid) eq 'pippo' )"](derived from <a href="<em><u>hidden link</u></em>">xx[types field='pactionid'][/types]</a>)[/wpv–conditional]

The "cred_show_group" shortcodes are all wrapped outside the tr tags in the table and when the div for the conditional wrapper is included, this makes your page's markup invalid.

To avoid this you can insert a new table in the tr tag and wrap it in the conditional shortcode so that the entire table shows or hides.

For example, currently, you have:


[cred_show_group if="( $(pactionid) ne 'pippo' )" mode="none"] 
	<tr>
		<th class="tg-au6fr">PARENT</th>
		<th class="tg-ioj1l"></th>
	</tr>
[/cred_show_group]

You can change it to:


<tr>
	<td colspan="2">
		[cred_show_group if="( $(pactionid) ne 'pippo' )" mode="none"]
			<table>
				<tr>
					<th class="tg-au6fr">PARENT</th>
					<th class="tg-ioj1l"></th>
				</tr>
			</table>
		[/cred_show_group]
	</td>
</tr>

I hope this helps and please let me know how it goes.

#1396553

My issue is resolved now. Thank you for your support!