Tell us what you are trying to do?
I am editing a Content Template in Blocks. There is a hidden field (_direction_event) that is on the old template but I am not able to use insert it in Blocks using Fields and Views - see attached screenshot.
On the Toolset Settings it says that this is showing - see attached.
Why am not able to insert it into my content template?
Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/custom-content/using-third-party-hidden-fields/
Is there a similar example that we can see?
https://toolset.com/documentation/user-guides/custom-content/using-third-party-hidden-fields/
What is the link to your site? hidden link
Hi Gina,
Thanks for asking! I'd be happy to help.
In my test with a hidden field ( screenshot: hidden link ), I was able to access it in the condition builder GUI of "Fields and Text" block as well as the "Conditional" block.
"Fields and Text" block: hidden link
"Conditional" block: hidden link
If any particular hidden field from another plugin is not appearing in the condition building GUI, you can use the field's shortcode ( i.e. [wpv-post-field name='_direction_event'] ) directly in a condition too:
( ref: https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/ )
Example:
[wpv-conditional if="( '[wpv-post-field name='_direction_event']' ne '' )"]
Show this when _direction_event field value is not empty
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-field name='_direction_event']' eq '' )"]
Show this when _direction_event field value is empty
[/wpv-conditional]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
I am a bit confused - I dont really know what is the GUI. The screenshots that you sent me refer to a 'loop template' and I dont know what that means or how does that apply to the field that I am trying to show.
I did try to directly copy the short code from the Old template and I also need to include your shortcode to only show this entire Text and Views if there is an actual value on the _direction_event field.
Thank you
Thanks for writing back and I apologize if my last message caused some confusion.
> I am a bit confused - I dont really know what is the GUI. The screenshots that
> you sent me refer to a 'loop template' and I dont know what that means or
> how does that apply to the field that I am trying to show.
- I used the "_view_loop_template" field just as an example, as I don't have the "_direction_event" field on my test website.
From the GUI (graphical user interface), I meant the options based conditional builder, as shown in my two screenshots:
"Fields and Text" block: hidden link
"Conditional" block: hidden link
> I did try to directly copy the short code from the Old template and I also need
> to include your shortcode to only show this entire Text and Views if there is an
> actual value on the _direction_event field.
- If I understand correctly, the result of using the manually built condition through "wpv-post-field" shortcode was what you reported in the other ticket:
https://toolset.com/forums/topic/using-conditional-display-in-template/#post-1586509
If that is correct, I'll suggest following my recommendation in reply to that message and we can continue this discussion on that same ticket.
You're welcome to mark this ticket as resolved, to avoid any further confusion/cutter.
What I am trying to do is: Combine the shortcode that you gave (only show field if there is a value) me AND the shortcode that I have (the field is only shown if the Usesr is Logged In) - I need your help making sure that the coding is correct.
Can you please check below? thank you
[wpv-conditional if="( '[wpv-post-field name='_direction_event']' ne '' )"]
Show this when _direction_event field value is not empty
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-field name='_direction_event']' eq '' )"]
Show this when _direction_event field value is empty
[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'false' )"]
Please register and sign-in to view venue details.
[/wpv-conditional]
[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'true' )"]
[wpv-post-field name='_direction_event']
[/wpv-conditional]
[/wpv-conditional]
Strictly theoretically speaking, the nested conditional block that you've shared is correct.
( ref: https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/nesting-and-combining-conditions/ )
But practically, it would again depend on how the event/ticketing plugin stores the empty/default value in the "_direction_event" field.
I can perform some quick tests on your website to see how value is stored in this field in different scenarios if you could share temporary admin login details along with the information about the new and old content templates.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
Hi, I pasted the short code into the template and must have done something wrong because the address is now showing twice - see attached.
I originally combined the 2 shortcodes so that is why it appears twice. If you can help me fix it. Basically, this field should only show if both conditions are met: 1) the User is logged in AND 2) the field is not empty.
In case you need them, my login credentials are on the screenshot attached.
Thank you
It is not safe to share the website's admin access details through screenshots as they are public.
Please reset the password for this user immediately as it has been exposed and share the updated password, in the next private reply, in it's designated field.
I've set your next reply as private.
The code that I asked you to checks is wrong. You did not even review it!
I've spent hours trying to fix it when you could just help me by checking it..and now you want to do tests which are NOT necessary.
Please just check my code to make sure it works
Not resolved but don't wish to work with you anymore. All you had to do is check the code but you did not and you said it was fine when it wasnt..dont want to work with you again