Conditional display of a view

By: Jane Onorati | Asked: 06/22/2022
ForumsCategory: General questionsConditional display of a view
Jane OnoratiJane Onorati asked 2 years ago
I have a page with views that are filtered by the value of a url parameter.  The page displays info for an event, and the parameter is the key for one event entry.  I now have one event that I want to display an additional view for, but don't want this view to display for other events.  Any suggestions on how this could be done?
1 Answers
Bobby Clapp answered 2 years ago
Maybe this -> https://formidableforms.com/knowledgebase/create-a-view/#kb-display-a-single-entry
Jane OnoratiJane Onorati replied 2 years ago

<p>I should have explained more. The new view is a table of entries, not a single entry and I want to make the display of the entire view on the page conditional on the url parameter.  There are two other views that are displayed on this page.  I want those to display for every event (according to the url parameter), but this new third view, only for one of the events.  Each view is based on a different form, so different set of entries displayed by each.  One displays information about the event, another displays sign-ups for the event, and this new one displays responses to questions about the event submitted by those who signed up for it.  The question form was only presented to those that signed up for one particular event.</p>

Bobby Clapp replied 2 years ago

You need to find something unique about the event (entry ID or key) and use that as a parameter to pass to a form and then use [get param=parameternamehere] in the form field. Then you can use that as a filter in the view that you can define manually or dynamically.

Jane OnoratiJane Onorati replied 2 years ago

No, you cannot make a view not visible, you can only show that there are no entries. I think I'll have to settle for that. I don't have a field in this particular form right now that has the event key in it. This form is only for one event so I did not think I'd need that. I'll need to add that to the form with a default value of the one event key the form is for. Then I can filter for it in the view. On the page that displays the views, this view will still display for other events but will display no entries.

Bobby Clapp replied 2 years ago

Here is a version of how that might work -> https://www.techmavenconsulting.com/2022/06/22/formidable-pro-secure-data/

Jane OnoratiJane Onorati replied 2 years ago

Bobby, thanks for the code. This is off topic, but I wish I could use this for forms. I have a form used for members renewing and it is populated with their existing membership data using frm-field-value shortcodes and a url parameter of the entry key for the membership data. I would prefer longer entry keys to make this more secure, but Formidable does not offer a way to increase the length of keys. Do you know if you can use this code to change entry keys? This would need to happen before my MailChimp and API actions fire after entry creation.

Jane OnoratiJane Onorati replied 2 years ago

Actually thinking more about it, I think the code might run before entry keys are even created, but am not sure.

Bobby Clapp replied 2 years ago

That is a bit more complex. Maybe you can have it so your registered users use a formidable form to register and add user meta that is their "token". Then alter the frm-field-value where that value of the field references another field id (the token field) where the value is equal to the "token".

This is all concept in my mind and may not be able to be done.

Jane OnoratiJane Onorati replied 2 years ago

Well my members are not registered. I am able to send them a link to renew with the entry key parameter using MailChimp. The entry key is added to a field for each subscriber by a MailChimp action after they join or renew, so is available to add to links in emails to them when needed.

Bobby Clapp replied 2 years ago

I'm not familiar with MailChimp. How are you adding the entry key parameter to MailChimp?

Jane OnoratiJane Onorati replied 2 years ago

In MailChimp, you can add fields to store additional data for each subscriber in addition to their email address. Then in the form, Formidable has a MailChimp add-on action that will add or update a subscriber and those MailChimp fields can also be populated with entry field values. It's very useful for more than just sending links with entry key parameters. I started using MailChimp because before I had to manually add new members to a Google Group. Now it happens automatically!

Bobby Clapp replied 2 years ago

Maybe you can use merge tags to generate the entry key instead of my code.

https://mailchimp.com/help/all-the-merge-tags-cheat-sheet/#Conditional_merge_tags

I see this *|UNIQID|*. Maybe that is a parameter you can pull into a field in formidable forms on the initial creation of a subscriber?

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right