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

As designed Graphic in Notice not showing in some areas

Affected version
xf 2.0.0. RC3

Bionic Rooster

Well-known member
#1
On the forum page the graphic shows in the notice however it shows as a broken link on What's new, Media, Resources, and Members page.
Screenshot_1.png
Screenshot_2.png
Am I missing something? Or is this a bug?
 

Kier

XenForo Developer
Staff member
#2
Could you post the code you've entered for the notice? We should be able to tell you what's going wrong once we see that.
 

Bionic Rooster

Well-known member
#3
Here you go
Code:
<div align="center"><img src="styles/default/xenforo/icons/lestweforget.jpg" width="480" height="253" /></div>
It's strange to me that it works on the forum page but not the others.
Thanks,
 

Kier

XenForo Developer
Staff member
#4
Try changing that <img src> to use an absolute URL.

If your styles directory lives at http://yourforum.com/path/to/your/forum/styles, you would use /path/to/your/forum/styles/default/xenforo/icons/lestweforget.jpg as the image source.
 

Bionic Rooster

Well-known member
#5
Try changing that <img src> to use an absolute URL.

If your styles directory lives at http://yourforum.com/path/to/your/forum/styles, you would use /path/to/your/forum/styles/default/xenforo/icons/lestweforget.jpg as the image source.
Yup that worked, thanks.
Any idea why the other method worked on forum page and not the others?
I guess I'll have to include the full URL in the future for XF2? "styles/default/xenforo/icons/lestweforget.jpg" works fine in XF1.5.xx
 

Mr Lucky

Well-known member
#6
Yup that worked, thanks.
Any idea why the other method worked on forum page and not the others?
I guess I'll have to include the full URL in the future for XF2? "styles/default/xenforo/icons/lestweforget.jpg" works fine in XF1.5.xx
it would probbaly work with a slash in front of styles ( /styles/default/xenforo/icons/lestweforget.jpg ) so that the path starts at the root.
 

Chris D

XenForo developer
Staff member
#9
Yup that worked, thanks.
Any idea why the other method worked on forum page and not the others?
I guess I'll have to include the full URL in the future for XF2? "styles/default/xenforo/icons/lestweforget.jpg" works fine in XF1.5.xx
We no longer hard code the base URL into the page, therefore URLs are always relative to the page you're on, rather than some base URL that we detect. This has been a big improvement behind the scenes as the base URL approach effectively screws up a lot of stuff (or at least makes it more difficult).

If your forum URL is https://example.com/ then styles/blah.jpg would be relative to that, e.g. https//example.com/styles.blah.jpg. If you navigate to https://example.com/members/ (for example) then styles/blah.jpg would be relative to that, e.g. https://example.com/members/styles/blah.jpg which is not going to work.

If your site is at the root like this, then it's just as simple as adding a / at the beginning e.g. /styles/blah.jpg. If your site is like ours, e.g. in the community directory then you would need to use /community/styles/blah.jpg.

So, this is as designed.