Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 28, 20186 yr 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?
August 29, 20186 yr 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.
August 29, 20186 yr Author Hardcoding a value does not seem to work either. The images do show up in my theme resources... Clearing the cache also didn't do the trick. This is strange...
August 29, 20186 yr The image(s) must be placed on \applications\your_app\dev\resources\front\ folder. Are they there?
August 29, 20186 yr Author Yes, well in \global. They have their own subdirectory below \global, but that shouldn't be an issue I guess?
August 29, 20186 yr I would try front. Global seems to be OK too: https://invisioncommunity.com/4guides/themes-and-customizations/advanced-theming/managing-resources-r129/
August 29, 20186 yr Author 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...
August 29, 20186 yr On 8/28/2018 at 11:12 PM, Thomas. said: <img src='{resource="Skins\Skin_{$character->model}.png" app="charmanager" location="global"}'> Hello, Why do you use backslash? Skins\Skin
August 29, 20186 yr Sorry, out of ideas too. I use it like that: <img src='{resource="crowdfunding.jpg" app="crowdfunding" location="front"}' class="ipsThumb crowdfundingImage"> The images is placed, in this case, on \applications\crowdfunding\dev\resources\front\: and it works fine:
August 29, 20186 yr Author On 8/29/2018 at 1:29 PM, 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!
Archived
This topic is now archived and is closed to further replies.