1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Get first post's image

Discussion in 'XenForo Development Discussions' started by grantus, Jul 21, 2015.

  1. grantus

    grantus Active Member

    How can I grab an image attachment from the first post of a thread? And would it work in a custom template?

    I tried using something like this:

    {$xf_attachment_data.filename}

    But don't know how I can get it working. Any ideas?
     
  2. Thomas.B

    Thomas.B Well-Known Member

    A little more info and context would be helpful. For example, in which template do you want to „grab“ the attachment? Can there be more than one attachment in the first post? If so, can there be more than one image?
     
  3. grantus

    grantus Active Member

    There would be more than 1 attachment but I want to grab the first.

    The template would be a custom one.
     
  4. Thomas.B

    Thomas.B Well-Known Member

    K, so you want to access the first attachment of the first post. That should be straightforward.. Would this custom template be included in another template?
     

Share This Page