Link problem with the URL field

Support General Link problem with the URL field

  • This topic has 4 replies, 2 voices, and was last updated 1 year ago by PeterPeter.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #45219
    AnLipAnLip
    Participant

    Hi.
    I have an issue with the URL type of custom field : I have a repeatable group containing only 2 fields : a text and a URL fields. The URL field is meant to be used when there is a link to add to the value of the other field (text). It works fine when I add a valid URL, but if the URL field is left empty, then it auto-attributes the post's url to the link.

    So on the frontend, I cannot have only a text value without it having automatically the current post's url, which is absolutely not fine.

    How can I avoid this ? Shouldn't the default behavior of a URL field be that if it is empty, then cancel the link purpose ?

    #45221
    PeterPeter
    Moderator

    Hello,

    Any field can be emptied when saving the post. Do you use any custom code to insert the current post URL into the custom URL field? And please let me know the field ID of those fields.

    #45222
    AnLipAnLip
    Participant

    The problem is that an empty field will cause the text to pick up the current post's url.

    My setup is as follows :
    - in Bricks, there is a LOOP (set to the Field Group named "designers-gf") that is set to loop through the results for the "MB Group: Références Bibliographiques" group.
    - The "designers-gf" field group includes (amongst other fields) this "MB Group: Références Bibliographiques" that has two fields : a text field "designers_ref" for the text, and "designers_url" for the URL.
    - In Bricks builder, I set the url value to apply to the link for the text. Therefore if there is a value for the URL it should be used for the link, but if there is no value for the URL it should just remain a text without a link.

    Now the problem is that when there is no value inserted to the URL field, the text element will by default pick up the current post's url and link to it. I need this to remain unlinked if there is no value added to the URL field. I feel that this is the way it used to work, but I can't figure out how to get there.

    #45227
    AnLipAnLip
    Participant

    Hi Peter, I'd also like to report that the documentation for the URL type of custom field does not exist, at least it redirects to another custom field's doc page : on this page https://docs.metabox.io/fields/ when you click on the "URL" type of field, it takes you to the doc for the Text field element. If you manually try https://docs.metabox.io/fields/url/ it doesn't work (404).

    #45235
    PeterPeter
    Moderator

    Hello,

    So the issue is in the frontend and related to Bricks builder, not Meta Box itself. I understand you can save the post with an empty URL field in the admin area. Please contact Bricks support to get further assistance.

    Regarding the documentation, the URL field is an HTML5 input field and there isn't specific documentation for this. Please read more about HTML5 input fields here https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types

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