Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello, thank you for telling me about this issue.

    Periodically it stops working..

    Strange.. I’m curious what specific condition is causing it. I tested both [loop] and [attached] and they seem to be working correctly.

    I think the clue is here:

    <a href= "target="_blank"">

    This is not valid HTML – however, the code you’re using looks correct. It could be that some special characters in the URL are causing it. Could you try the following to check what the URLs look like?

    <ul>
      [loop id="35291" status="any"]
        [attached]
          <li>[field url]</li>
        [/attached]
      [/loop]
    </ul>

    Also, in the newest plugin update, I added title-link and title-link-out for attachment fields. Previously, those fields were only available for post fields.

    Ahh, I also see in the link you posted, that there are unnecessary paragraph tags inside the list. This could be related to the issue.

    You can wrap the code block with the [raw] shortcode, to prevent formatting:

    [raw]
      ...
    [/raw]
    Thread Starter petroglyphic

    (@petroglyphic)

    Thanks for the quick response.

    The issue seems to be [field url]: your code above which should return a list of urls returns a list of empty list items.

    `<ul>
    [loop id=”35291″ status=”any”]
    [attached]
    <li>[field title-link]</li>
    [/attached]
    [/loop]
    </ul>’
    returns a list of the correct files, but they link to the post they’re attached to (“35291”) instead of the attachment file itself.

    Wrapping [raw] around [attached] gets rid of the paragraph tags, and the “” from href= no longer migrate to wrap target=”_blank” but doesn’t get the link:
    <ul><li><a href target="_blank">TITLE</a></li></ul>

    Thanks, Susan

    Plugin Author Eliot Akira

    (@miyarakira)

    Hmm, this is a tough one. I tested the exact same code – only difference being post ID – and the result is as expected: I get a list of attachment titles linked to the files themselves.

    I also tested whether status=”any” could be related. I tried draft/pending status, and they’re working.

    ..your code above which should return a list of urls returns a list of empty list items.

    This part is interesting – so there is a list, which means it’s getting the attachments – but the URLs are empty..

    Since I’m not able to reproduce the issue, it’s difficult to pinpoint what the cause is.

    • Are you using the newest version of the plugin?
    • Could there be other plugins that are affecting it?
    • Is there anything special about this particular post or the attachment files..?
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attachment [field url] not working in html’ is closed to new replies.