Skip Navigation

[Resolved] Showing default link correctly in cred form

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that when the user has a URL field and enter his homepage url into that field, it get printed as a / on the frontend.

Solution:

To resolve this you will need to use our conditional shortcode.

Here is an example below.

[wpv-conditional if="( $(wpcf-website) eq 'homepageurl' )"]<a href="[types field='website' output='raw'][/types]">Homepage</a>[/wpv-conditional]

 [wpv-conditional if="( $(wpcf-website) ne 'homepageurl' )"][types field='website' target='_blank' output='raw'][/types][/wpv-conditional]

Notice i've replaced the / with the text "Homepage"

This support ticket is created 6 years, 7 months 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.

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)

This topic contains 7 replies, has 2 voices.

Last updated by simranjeetS-2 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#643437
Screenshot 2018-04-10 18.57.43.png

I am trying to: show default url link correctly, I have a cred form. For a url box, my default link is my own website on which form exists. When I fill form it shows "/" as link. Not my website name. How to correct this?

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

I expected to see: Name of website

Instead, I got: "/"

#643487

Even on cred form, only "/" is shown. Not complete website hidden link

#644052

Shane
Supporter

Languages: English (English )

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

Hi Simranjeet,

I understand why this is happening. Its because the URL is the same as the website home link url.

So if a user was to input their own url then it wouldn't show as a / and would actually show the URL.

Try changing one of the URL and you can see what i'm referring to.

Thanks,
Shane

#646570

Hi Shane. I am using your words to make myself more clear.

I know that I am getting "/" because "... the URL is the same as the website home link url."

Thats what I dont want. I want to show complete"website home link url" - home page link of my own website as default form value + it is diaplayed in full

#649101

Shane
Supporter

Languages: English (English )

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

Hi Simranjeet,

Unfortunately it seems that if we use the link name as hidden link it will always get replaced with a / so what I did was to manually build the link and check it if its equal to the homepage url and then set the text as Homepage.

Please let me know if this helps.
Thanks,
Shane

#649744

I could not understand. Have you made any changes on website?
Edit -
I saw the changes. How do I do that? The process please.

#649997

Shane
Supporter

Languages: English (English )

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

Hi Simranjeet,

I must apologize for not being more detailed on this.

I've added this

[wpv-conditional if="( $(wpcf-website) eq '<em><u>hidden link</u></em>' )"]<a href="[types field='website' output='raw'][/types]">Homepage</a>[/wpv-conditional] [wpv-conditional if="( $(wpcf-website) ne '<em><u>hidden link</u></em>' )"][types field='website' target='_blank' output='raw'][/types][/wpv-conditional]

To the content template.
hidden link

Please let me know if this helps.
Thanks,
Shane

#652729

Thanks a lot