URL field

Support General URL fieldResolved

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #28052
    ThibautThibaut
    Participant

    Hello,

    I have an URL field, how to show in view the URL so it displays as an URL in frontend?

    it justs says the following when I want to include the URL in the view form:

    {% set field = attribute( post, 'publisher-url' ) %}
    {{ field }}

    but I am not sure what to do next?

    Thank you.

    #28057
    Long NguyenLong Nguyen
    Moderator

    Hi,

    To make the URL clickable, you just need to add it to the attribute href of a <a> tag.

    <a href="{{ field }}">{{ field }}</a>

    #28058
    ThibautThibaut
    Participant

    you are answering half of what I wrote...

    When I want to include the url, I have the followinng appearing, how am I supposed to make it work?

    {% set field = attribute( post, 'publisher-url' ) %}
    {{ field }}

    if I put
    {% set field = attribute( post, 'publisher-url' ) %}
    {{ post.publisher-url }} tried also {{ publisher-url }}

    it returns 0...

    #28059
    ThibautThibaut
    Participant

    It seems it caused bby the fact that I renamed the field and the ID, it lost all the data, is this normal? (used to have just url bbut was conflicting everytime I wanted the 'post-url' function...)

    #28060
    ThibautThibaut
    Participant

    how to solve this?

    #28062
    ThibautThibaut
    Participant

    I changed url to publisher-url in MySql, so the data are back into the post but still the above functions returns 0, what should b the function to return the url?

    #28063
    ThibautThibaut
    Participant

    OK, got it, thanks! ({{ field }} is nough)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.