Jump to content

Images not working in freshly installed application


Thomas.

Recommended Posts

Hi,

After finally completing version 1 of my application, I installed it on my production site. Everything works fine, except for my images. They appear to have been added to my uploads/set_resources_2 folder, but they do not show up anywhere where they are supposed to show. The source of the page just shows this: <img src="">. It works fine on my development installation.

Here's an example from one of my template files showing how I include the images:

<img src='{resource="Skins\Skin_{$character->model}.png" app="charmanager" location="global"}'>

Any ideas what's going on here?

Link to comment
Share on other sites

Variables inside the template plugin tag aren't really reliable (or more specifically, shouldn't be encapsulated in curly braces). If you hardcode a value for $character->model instead, does it work? If so, then your solution will be to assign the entire resource value to a variable and pass that like so

{{$resourceName = "Skins\Skin_" . $character->model . ".png"}}
{resource="$resourceName" app="charmanager" location="global"}

If that does not solve the issue, check all of your themes in the AdminCP and verify under the Manage Resources page that your resources were correctly imported to each theme, then run the support tool to clear your caches and verify if the issue persists.

Link to comment
Share on other sites

I've also checked the database (core_theme_resources) just to be sure, and everything looks okay there as well. So to summarize:

  • The files are there where they should be;
  • They are correctly listed in the database;
  • They show up in the AdminCP under theme resources;
  • The value that defines what image to use is now hardcoded in the template file

...and it still does not work.

Could it be some kind of obscure caching issue somewhere? I'm running out of ideas... :unsure:

Link to comment
Share on other sites

2 minutes ago, newbie LAC said:

Hello,

Why do you use backslash? Skins\Skin

  

You... you are magnificent! So I changed it to a forward slash and voila, it works! I guess it's just the force of habbit for me to use a backslash, especially when developing when you use lots of them for namespacing.

Thank you! :biggrin:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...