Hi@all,
we nearly finished a website with parametric search and related google maps 🙂
1) Now we have one problem with the data output. Instead of the value from the database f.e. "Zielgruppe: 1, 1, 1" we want to have the title: "Zielgruppe: Kinder, Jugendliche, Erwachsene". How is this possible?
2) We want the values and prefixes only be displayed, if there is a value in the database. So if there is no value, we want the prefix not to be displayed. We assume, that there will be many fields not filled, so we want these fields not to be displayed. Is this possible?
here is a link to the development site:
hidden link
Thanks and regards,
Chris
Hi christianK-3,
1) Are you using Types shortcode to output the custom field values?
Please try Types filter hook 'wpcf_fields_slug_[$slug]_value_display', for example, your custom field slug is "my_field",
you can try add codes in your theme/functions.php:
add_filter('wpcf_fields_slug_my_field_value_display', 'my_value_func');
function my_value_func($value){
if($value == 'ielgruppe: 1, 1, 1'){
$value = 'Zielgruppe: Kinder, Jugendliche, Erwachsene';
}
return $value;
}
2) please try views shortcode wpv-if to check if there is a value in the database. then display the field value
More help:
Checking for empty fields
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/#checking-for-empty-fields
Hi Iouy, thanks for answering, a colleague will come back to you. But we have a third question:
We have a custom post type "members" and want to display in the public area less information than in the protected area. Is this possible with two different templates?
Thanks, have a nice weekend, Chris
Yes, it is possible within Views filter hook wpv_filter_force_template
Filters the ID of the Content Template that is going to be applied to a post.
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_force_template/
Hi luoy,
I'm sorry to say, but I do not understand the filter documentation. I think, that it can not be so complicated, only that I do not understand the terms and the logic. I thought, that views is more for the designer than for the programmer.
So recently I duplicated the parametric search form and tried to assign two categories to the custom post type "members" in order to display on one page the external version and on another page the internal one. It is all solved and it's working. This is the last milestone, we have to reach.
*confused* can you help me out?
Thanks... Chris
Could you describe more detail for the question?
What is the confused?
Since your request is very special, and it need custom code, if you need more help for it, please describe detail steps to duplicate same problem, I can try test in my localhost and create a demo function for you.
Hi luoy,
we have one custom post type "members". These members are psychologists. They put their data using a gravityform in the database/ custom post type. The information is displayed first in the public part of the page using a parametric search with google maps and second in a restricted area for the members.
The problem is, that in the public part of the site we have to display less information than in the restricted part, because some information is interesting only for other members and not for patients.
Maybe it is easy, maybe it's not. I can provide you now acces to the testing platform or I can provide you the entire site zipped with duplicator for installing it on your local machine. Please send me a private message for this, ok?
Thank you again luoy°
regards, Chris
Please fill below private details box with your test site login details, I need a live website to test and debug. thanks
Hi luoy, here come the access data. If you need assistance or have questions: I am heretoday only for 30min more and then again on friday. Thanksagain 🙂 Access to FTP via TLS/SSL have a good time!
How do you define the patients and members?
Is the patient a visitor without logged in, and member is the user logged in?
If it is, please try wpv-if shortcode to check if current user is logged in then display different content template for the user:
[wpv-if evaluate="'[wpv-current-user info="login"]' = ''" condition="false"]
put the content template here show for user is logged in
[/wpv-if]
[wpv-if evaluate="'[wpv-current-user info="login"]' = ''" ]
put the content template here show for user isn't logged in
[/wpv-if]
More help:
Checking for the current user data
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/#checking-current-user
Hi luoy,
we didn't want to manage the members in the WordPress backend, so we decided to have an area with restricted access using a plugin called "private blog". So in fact, "patients" are normal visitors and "members" are as well normal visitors, but with the password for the access to the restricted area.
Do you think, that the other way using the backend of wordpress for managing uses would have been the easier way?
Thanksalot, Chris
I suggest you try create custom user Groups for patients and members with Access plugin,
https://toolset.com/home/types-access/
More help:
Limiting read access to specific content
https://toolset.com/documentation/user-guides/limiting-read-access-specific-content/
Hi luoy,
what you concern is, to use the wordpress backend for the members? So that every member has his own access and password, correct? So to view the internal area it is necessary to log in with the personal account. This is another strategy to display the content than we had.
What do you think:
1) how much time is necessary to implement this functionality?
2) how is it possible, that every member can edit his own data (custom post type "members")?
All in all, I would give another day of work to this project if then everything is fine. We spent yet much more time on this project than we planned. Another possibility you don't see?
Thanks again for helping, regards, Chris
Yes, you are correct, with Access plugin, every member has his own access and password, and to view the internal area it is necessary to log in with the personal account.
1) it depends on how many members you need apply to your custom member groups
2) yes, it is possible with Access, you can enable "Edit own post" option for your custom user groups.
If you insist to use other plugin "private blog", it may need custom works, please try check our certified partners:
https://toolset.com/consultant/
Hi luoy,
I will have a look tomorrow and will test it on another platform to see, how it works and how much time we need to spent on it. Is there a test version of the access plugin?
regards, Chris