November Happy Hour will be moved to Thursday December 5th.

Images are not showing when not logged in as WebAdmin

Vote:
 

Hi,

I really can't seem to find out why this is happening, but I'm having the following issue when attempting to display an image on a page.

1. The image was uploaded into the file manager
2. The image was added to a page using the XHTML editor
3. Image displays whilst logged in on this page

Now here's what I'm doing with that image:

The image is part of an advert that can be shown on any page within the site. The advert containing the image is loaded onto the page. This works fine whilst in admin mode; however when viewing the page normally, the image will not display. All surrounding text will.
On  inspecting the page I can see that there is an additional style attribute added to the image:

style="display: none !important; visibility: hidden !important; opacity: 0 !important; "

To make the above clearer, here is the code that actually gets the advert text:

 

var pageBase = HttpContext.Current.Handler as PageBase;
                PageData currentPage = pageBase.CurrentPage;
                var links = currentPage.Property[AdvertPropertyName].Value as LinkItemCollection;
                if (links != null)
                {
                    if (links.Count > 0)
                    {
                        var random = new Random();
                        int number = random.Next(links.Count);
                        PageReference pageLink = PageReference.ParseUrl(links[number].GetMappedHref());
                        PageData pageData = DataFactory.Instance.GetPage(pageLink);
                        AdvertLiteral.Text = pageData.Property["MainBody"].Value.ToString();
                    }
                }
I'm presuming it's some sort of permissions thing, but can't see what.

Any help greatly appreciated.

Thanks,
Henrik 

    

#57566
Mar 21, 2012 13:04
Vote:
 

That style-attribute must come from something built into your project...

If you suspect permisson problems you could try to add Everyone role to the file manager directory in question.

#57691
Mar 24, 2012 0:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.