• Creator
    Topic
  • #28052
    Resolved Thibaut
    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #28057
    Long 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
    Thibaut
    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
    Thibaut
    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
    Thibaut
    Participant

    how to solve this?

    #28062
    Thibaut
    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
    Thibaut
    Participant

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

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