Skip Navigation

[Resolved] How to add a dynamic link

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.

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 6 replies, has 2 voices.

Last updated by Shane 5 years ago.

Assisted by: Shane.

Author
Posts
#1437999
Annotation 2020-01-04 001803.png

Tell us what you are trying to do? I want to add company name as dynamic custom field and be able to add a link to company website that will also be added in backend

Is there any documentation that you are following? yes toolset documentation

Is there a similar example that we can see? cant find one

What is the link to your site? hidden link username demo pswd demo12 to access site

#1438357

Shane
Supporter

Languages: English (English )

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

dynamic source.PNG

Hello,

Thank you for getting in touch.

If you are using the Single Field block with your Toolset plugin you will need to use the Post Title with Link dynamic Setting, see screenshot

Please let me know if this helps.
Thanks,
Shane

#1440657

It is not going to be link from post title .
Dynamic text LinkedIn and then link it to separate LinkedIn profile for each company.
Thanks

#1441737

Shane
Supporter

Languages: English (English )

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

Hello,

If the link to the LinkedIN profile was added to a custom field then you can do this.


<a href="[types field='my-url-field-slug' output='raw'][/types]">[wpv-post-title]</a>

The above code would be for if the company name is stored as the post title. If the company name is stored in another custom field, you will use the example below.


<a href="[types field='my-url-field-slug' output='raw'][/types]">[types field='my-company-field-slug' output='raw'][/types</a>

Where you will replace the field names with appropriate slugs for each.

Please let me know if this helps as this should give the desired results.

Thanks,
Shane

#1441859
Capture.PNG
Capture.PNG

I have attached images how I have added in backend but in front end it is not displaying correctly.

#1441895
Capture.PNG
Capture.PNG
Capture.PNG

Ok I have fixed the Bracket issue but now link is getting site url to it rather than going to actual external url
hidden link

it should go to google.com but it is adding site url in the front ,

I have tried wysiwyg editor and same thing is happening with that, in html it is showing google.com but when i click it is adding site url to it.

#1442643

Shane
Supporter

Languages: English (English )

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

Hello,

This could be because of the quotation mismatch with your code. If you have a look at my example below


<a href="[types field='my-url-field-slug' output='raw'][/types]">[types field='my-company-field-slug' output='raw'][/types]</a>

You will notice that I used a mixture of single and double quotes. The single quotes are used within the types shortcode and the double quotes wrap around them in the href attribute.

Try updating your code to match this formatting and let me know if the issue still remains.

Thanks,
Shane