Skip Navigation

[Closed] Displaying content according to login information

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 support ticket is created 9 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
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 4 replies, has 3 voices.

Last updated by Denise 9 years, 2 months ago.

Assisted by: Denise.

Author
Posts
#281521

Hi,

I have been using the free version of "types" at the moment, which is great for creating new custom most types. I am really tempted to buy the whole thing, with views included, but I have a question first.

I am trying to display specific content for users of the websites, according to their login id. Roughly, using php, it would go something like this :

if
user A is logged in
{
while have posts in custom taxonomy "user-A", query "user-A" posts, and displays the content given to user A
}
else
{
you don't have the rights to views that section
}

and then if user B is logged in, displays the content for user B, and so on..

I was wondering if Views would allow me to do that in a simpler way, or if I need to code the whole thing myself.

Thanks very much for your input : light is needed on that subject. I also apologize if I cannot paste the real code because it is related with medical content : the custom post types I created are patients sheets, with a taxonomy for their doctors : the goal is to allow access to the doctors for the right patient, and to block any other physician.

Best regards,

Stefan

#281791

You can do tis with conditional html outputin views. https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

Use the [wpv-current-user] shortcode to find the current user and display text based on who he is.

[wpv-if evaluate="'[wpv-current-user info="login"]' = 'bruce'"]Bruce is logged in[/wpv-if]

or

[types] shortcodes – shortcodes from the Types plugin, used to display custom fields for single posts or inside Views listing posts. It can also be used to check Types usermeta fields:

[wpv-if evaluate="'[types usermeta="user-single-line"][/types]' != 'something'"]leave out a given value[/wpv-if]
[wpv-if evaluate="'[types usermeta="user-single-line"][/types]' = ''"]check for an empty field[/wpv-if]
#284215

I will try that then, and get back to you if it works or if it doesn't. One last question about Toolset : I saw the whole pack is at 299 USD : is this for one website, or can I use it with as many websites as needed ?

#284588

Waqas
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

This is Waqas here, on behalf of Ms. Denise. She's on vacation and will join back on Monday.

Yes you can use it for as many sites as you want, there's no such restriction 🙂 However, you can ask for more about this at https://toolset.com/#free-consultation

She will follow up with you, as she returns. Thank you for your cooperation and patience.

#285091

Please let me know if you have any more questions.

The topic ‘[Closed] Displaying content according to login information’ is closed to new replies.