News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom field image not appearing on profile view

Started by LWillisjr, January 03, 2023, 12:20:46 PM

Previous topic - Next topic

LWillisjr

Running SMF 2.1.3

Have created a custom field to show a members country flag. I uploaded all the flag images into the [root]/images folder. Have selected these to be shown on the memberlist, and the topic view. It works perfectly on the memberlist view, but is not working on the topic view.

Here is my setup for the custom field.  Using the following to display the flag images:
<img src="images/{INPUT}.png" alt="{INPUT}" /> {INPUT}
You cannot view this attachment.


 This is a view of the memberlist which is working perfectly.
You cannot view this attachment.


This is the topic view and seems it is not finding the images as it is showing the alt text. I've set the placement to "below avatar"
You cannot view this attachment.

Shades.

#1
Try changing:
<img src="images/{INPUT}.png" alt="{INPUT}" /> {INPUT}
To:
<img class="section" src="https://yoursite.com/images/{INPUT}.png" alt={INPUT}" />
This is the way it is set up on my site and works! ;)

Or maybe try:
<img class="section" src="images/{INPUT}.png" alt={INPUT}" />
This works too! 8)

Edit: You may have to clear your forum and browser cache after you make the changes in order to see the images.

Reference: https://www.simplemachines.org/community/index.php?topic=578961.msg4097962#msg4097962
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

LWillisjr


Advertisement: