Skip Navigation

[Resolved] Output from Database

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

This topic contains 17 replies, has 2 voices.

Last updated by christianK-3 6 years, 12 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#234878

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

#234965

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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

#235355

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

#235605

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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/

#238498

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

#238844

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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.

#238870

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

#239094

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Please fill below private details box with your test site login details, I need a live website to test and debug. thanks

#239217

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!

#239488

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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

#239491

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

#239712

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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/

#239835

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

#240328

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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/

#240341

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

The forum ‘Types Community Support’ is closed to new topics and replies.