• This use to work perfectly some time ago:

    <a href="[content type='text-blocks' name='tickets-banner' field='link']" class="btn btn-lg btn-theme-lite">Click here</a>

    I have an ACF field actually called, link not to be confused with the new shortcode [link].
    My ACF field needs to contain an external url like this: https://mysite.com

    Unfortunately, the output is now invalid and dysfunctional:

    <a href="<a href=" http:="" mysite.com="" text-blocks="" tickets-banner="" "="">Tickets Banner</a>" class="btn btn-lg btn-theme-lite">Click here

    Also, I tried deactivating the [link] shortcode under Settings, but it had no effect.

    So, how should this be implemented now?

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Did you try to rename the ACF field to something else? For example: external-link.

    The field “link” is already in use for every post and renerates a link to the post.

    This is exactly what happened to me – see my ‘maito’ post, just below this.
    It was working.
    Sorry this isn’t an answer – but atleast its not just me!

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    Thanks, Peter, for pointing out that link is a predefined field name. That’s why it’s outputting a link inside a link.

    This is a design flaw, that the field parameter looks for a predefined field with that name, then a custom field. So it cannot display a custom field which has the same name as a predefined field – such as title, link, etc.

    In the newest plugin update, I added a parameter to resolve this. Please set custom=true to get a custom field that has the same name as a predefined field.

    [content type=text-blocks name=tickets-banner field=link custom=true]

    Not so elegant, but at least you don’t have to change the field name.

    Thread Starter polyfade

    (@polyfade)

    Thanks everyone. @eliot Akira I tried adding custom=true, but that didn’t seem to work exactly. While it now returned my custom field, link, as text, it also returned the link of the post as a url. The result was mashed up.

    If you’d like me to set up a sandbox demo, I can, but I’m not too concerned now since changing the custom field from link to custom_link works just fine.

    Plugin Author Eliot Akira

    (@miyarakira)

    Oops, I forgot that some predefined fields get wrapped in a link before it’s returned. I’ll fix this in the next update.

    Using the [link] shortcode is another way to build a link from a field value, and is actually now more recommended than using a shortcode inside an HTML attribute. I also added the custom parameter for it.

    [link type=text-blocks name=tickets-banner field=link custom=true]Click here[/link]
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Confused about specifying URLs’ is closed to new replies.