Skip Navigation

[Resolved] Entire search results behaving like a hyperlink when user is not logged in

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 1.65 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by simonM-5 5 years ago.

Assisted by: Shane.

Author
Posts
#1378957

I am trying to:
Using custom seach on the homepage hidden link a user can choose a Type of Work and a Native Language and click Find a Native Nanny. They are then navigated to the page Find a Native Nanny (hidden link) to see the results. Each result is displayed like a little grey card. We configured the name under the card to be the link to see the "full" Nanny profile. The titles in this "card" should be green and the content thereunder written in a grey font.

When a user is logged in as a Nanny or as a Family, everything works as expected. But for non-logged in users, the entire card is behaving like a link, when we have actually only enabled clicking on the Name under the photograph to take the user to the "full" profile of a Nanny.

We checked with all modern browsers and the behaviour is the same.

Link to a page where the issue can be seen:
hidden link

So we have a few related questions:
1) why is the entire "card" behaving like a hyperlink when a user is not logged in and not when the user is logged in?
2) we presume the font is displaying as green always, even for the content, because the entire card is behaving like a hyperlink, correct?
3) We actually like the fact that the user can click anywhere on the card area to access the full profile. So is it possible to configure that, but still maintain the difference in the colour of the two texts (ie titles in capital green letters, and content of each field in the grey colour?)

If you need to, please feel free to register as a Nanny or as a Family so you can log in and out and try stuff. It is a dev environment.

Thanks and regards
Simon

#1378999

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Simon,

Thank you for getting in touch.

1) why is the entire "card" behaving like a hyperlink when a user is not logged in and not when the user is logged in?

So for the entire post being clickable it has to do with this code here


<h2 style="text-align: center;"><span style="color: #5f9ea0;"><strong><a href="[wpv-post-url]"><span lang="en-US">[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'true' )"]</span>[wpv-post-author meta="user_firstname" format="meta"]</a></strong></span><span style="color: #5f9ea0;"><strong>, [time_ago birthdate='[types usermeta="nanny-date-of-birth" raw="true" user_current="false"][/types]'] <span lang="en-US">[/wpv-conditional]</span></strong></span></h2>

Not sure why you're added the items outside of the conditional as well as the span since the correct way to implement this is to have it inside the conditional like this.

[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'true' )"]


<h2 style="text-align: center;"><span style="color: #5f9ea0;"><strong><a href="[wpv-post-url]"><span lang="en-US">]</span>[wpv-post-author meta="user_firstname" format="meta"]</a></strong></span><span style="color: #5f9ea0;"><strong>, [time_ago birthdate='[types usermeta="nanny-date-of-birth" raw="true" user_current="false"][/types]'] <span lang="en-US"></span></strong></span></h2>

[/wpv-conditional]

This should resolve the issue because you only want to display something different if the user is logged in.

"2) we presume the font is displaying as green always, even for the content, because the entire card is behaving like a hyperlink, correct?"

Are you making reference to the non-hyperlinked text?

3) We actually like the fact that the user can click anywhere on the card area to access the full profile. So is it possible to configure that, but still maintain the difference in the colour of the two texts (ie titles in capital green letters, and content of each field in the grey colour?)

It is possible but you will need to hyperlink the entire section. Also im not sure why you've setup a conditional for both logged in and logged out users when the content to display is effectively the same.

I would remove the conditionals. Wrap everything in an anchor tag, then wrap the individual texts in various spans and then style those spans.

Please let me know if this helps.

Thanks,
Shane

#1379951

My issue is resolved now. Thank you!