Not a bug The images in the notices are not displayed everywhere

ratix_gunz

Active member
Affected version
2.0 BETA 6
Hello,
I noticed a bug (which I wanted to report before the Beta 6), the images put in notices are not displayed on all the pages.
For me, they are only displayed on the list of forums.

They can sometimes enlarge the notice on the whole page (according to the browser).

Here is my code (which I have to use):
HTML:
<center>
<a href="https://yourlink.com"  target="_blank"><img src="https://yourimg.png" style="display:block; width:100%;"  title="" /></a>
</center>

Capture d’écran 2017-10-11 à 23.51.25.webp

Capture d’écran 2017-10-11 à 23.54.43.webp
 
Last edited:
I have to imagine this is likely related to ad-blocking software, or something of that nature, because I haven't been able to reproduce this at all here, using precisely your code, except for changing the href and src URLs.
 
I have to imagine this is likely related to ad-blocking software, or something of that nature, because I haven't been able to reproduce this at all here, using precisely your code, except for changing the href and src URLs.
I have tried with Mac OS Safari, Google Chrome, Mozilla, Vivaldi, Internet Explorer as well as other devices under Android, iOS and Windows (without adblocker). I also tried with a new xenforo 2 installation but it still persists. On the other hand, under xenforo 1, I have not encountered this problem.

Could you try switching your notice type to 'block' and see if that has any effect?
I have just tried block and the result is the same
 
We'd need to see the actual code in your notice. Your example implies you're using an absolute path to your image, but I suspect this isn't the case. You should use an absolute path (or at least a path starting at the root with a /) to ensure it displays correctly in all scenarios.
 
We'd need to see the actual code in your notice. Your example implies you're using an absolute path to your image, but I suspect this isn't the case. You should use an absolute path (or at least a path starting at the root with a /) to ensure it displays correctly in all scenarios.
Here is my code:
HTML:
<center>
<a href="https://mysite.com/threads/313/"  target="_blank"><img src="lg/lgpg1.jpg" style="display:block; width:100%;"/></a>
</center>
 
In fact it is a server error (404) which I do not know the explanation because under xf1 or even other sites, I never put a "/" whereas now I must have it.So, my problem is solved and excuse me for the inconvenience for so little.
 
Right, it is as I expected then. You need to use an absolute path for any images you embed in custom HTML areas.

The reason you didn't need this in XF1 was because we use a <base> tag, but you would run into this in other places (not XF related) because with friendly URLs enabled, the "directory" seen by the browser changes from page to page.
 
Top Bottom