You need to sign in to do that
Don't have an account?

Trailhead- "Using Static Resources" challenge
Hi ,
I was trying to solve the trailhead challenge under "Using Static Resources".
Am getting following message:
Challenge not yet complete... here's what's wrong:
The page does not include a reference to the specified image
Following code am using.
Regards,
Manjunath C Sarashetti
I was trying to solve the trailhead challenge under "Using Static Resources".
Am getting following message:
Challenge not yet complete... here's what's wrong:
The page does not include a reference to the specified image
Following code am using.
<apex:page > <apex:pageBlock title="Pic" > <apex:pageBlockSection > <apex:image value="{!URLfor($Resource.vfimagetest, '/cats/kitten1.jpg')}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:page>Am I missing something here?
Regards,
Manjunath C Sarashetti
changed the inital code to from <apex:image value="{!URLfor($Resource.vfimagetest, '/cats/kitten1.jpg')}"/> this to this
<apex:image value="{!URLfor($Resource.vfimagetest, 'cats/kitten1.jpg')}"/>.
Problem was with '/'
Regards,
Manjunath
You have done a little mistake in specifying the URL,it should be the following
<apex:image value="{!URLfor($Resource.vfimagetest, 'cats/kitten1.jpg')}"/>
Paste the above one ,this will solve the problem.
Thanks,
Rashi Krishan
Mirketa Software Pvt Ltd
http://mirketa.com/index.html
<apex:includeScript value="{!$Resource.vfimagetest}"/>
<apex:image url="{!URLFOR($Resource.vfimagetest, 'cats/kitten1.jpg')}" width="auto" height="auto"/>
<apex:image url="{!URLFOR($Resource.vfimagetest, 'cats/kitten2.jpg')}" width="auto" height="auto"/>
</apex:page>
<apex:page >
<apex:image url="(!URLFOR($Resource.vfimagetest,'cats/kitten1.jpg')}"/>
</apex:page>
But keep getting an error message..Challenge Not yet complete... here's what's wrong:
The Static Resource 'vfimagetest' was not found. Am I missing something?? Thanks!!
You need to upload the zip file as a static resource. Follow the instructions under "Create and Upload a Zipped Static Resource" in the module.
Thanks Dan! I figured it out!
Why doesn't it work with URL?
<apex:image url="{!URLFOR($Resource.vfimagetest, 'cats/kitten1.jpg')}" DID NOT WORK FOR ME... i replaced 'url' for 'value' => <apex:image value="{!URLFOR($Resource.vfimagetest, 'cats/kitten1.jpg')}" and it DID WORK! - Easy confusion.
Also, in the challenge, there is a link within the writing to the zip file you need. I read fast, missed that bit and made my own, and it did not like that.
The exercises on that module are wrong too. After coming here, I was able to fix the sample exercise as well. You have to remove the "jquery.mobile-1.4.5/" out of the URL lines on the VFP: jQueryMobileResources
Working Code below:
Try to do these steps after to run your VF code:
// Creating and Uploading a Simple Static Resource: When your static asset is not related to other assets—that is, not part of a set of similar assets such as a group of icons—it’s easiest to create a stand-alone static resource. 1. From Setup, enter Static Resources in the Quick Find box, then select Static Resources, and then click New. 2. Provide a name for the static resource 3. Click Choose File, and then choose the file you want to upload. 4. If you see the Cache Control menu, choose Public. This item isn’t visible in all organizations. 5. Click Save.
Now run the code :
<apex:page >
<apex:includeScript value="{! $Resource.vfimagetest }"/>
<apex:image url="{!URLFOR($Resource.vfimagetest, 'cats/kitten1.jpg')}"/>
</apex:page>
P.S : Dont change url with value,else it will show the error of getting no image tag.
step 1 create the static resoource...vfimagetest in the Setup panel of the trailblaze
step 2 the code.using the console