• Agendum
• NEWBIE
• 0 Points
• Member since 2011

• Chatter
Feed
• 0
• 0
• 0
Likes Given
• 6
Questions
• 3
Replies

I am coming from an ASP.NET background.  Does Salesforce have any concept of Master Pages?  If so, how is it done?  Thanks!

Right now my pages are all sitting at the root:

/apex/foo

/apex/bar

/apex/sub_one

/apex/sub_two

Is there any way to create a subfolder, such as:

/apex/foo

/apex/bar

/apex/sub/one

/apex/sub/two

If so, can I also create a default for sub?

/apex/sub

Thanks!

I am helping a company migrate from IIS to Salesforce using apex.  One thing I just recently came across was their large global.css contains tons of url() calls.  For example:

#logo {
display block;

background:url("/images/foo/bar/.png") no-repeat scroll

/* ... */

}

There are literally hundreds of asset references like this - even for fonts:

@font-face {
font-family: 'CustomFont;
src: url('CustomFont.eot');
src: local('Custom Font'), local('CustomFont'), url('CustomFont.woff') format('woff'), url('DroidSans.ttf') format('truetype'), url('CustomFont.svg#DroidSans') format('svg');
}

Does URLFOR work within CSS files?  I suspect not.  If not, for elements which use url() the only thing I can think of is to find each of the million elements and hard code that CSS attribute.  Is there a better way?  Also, what would be a solution for non-element styles such as the one above?

Thanks

Hi,

\staticresources\images\codename\foo.jpg

\staticresources\images\codename\bar.jpg

So I found $Resources, but the docs don't really answer how to reference images in subfolders. How can I use URLFOR and$Resources to get the path to these images?

Once I get an answer to that question, I have a followup... do I have to use <apex:image> instead of using <img> with the URLFOR to render an image?  If not, what is the advantage of using <apex:image> over <img>?

Thanks!

I know this is a very simple question, but my search in the IDE help revealed nothing.  If I have a method in a controller, how do I execute it in the view?  For example:

// ----------------------

// In the controller

public static String test(String arg)
{
return arg;
}

// ----------------------

// In the view

<div>{!test('foo')}</div>

Thanks!

~ devin

Hi, I come from C# land and am new to Apex.  I am simply trying to get access to the User.FirstName value in the controller.  I can do this in the view just fine:

{!$User.FirstName} Below are examples of my attempts at doing this... // In the view: // ----------------- {!test} // In the controller: // ----------------- // Compiler error: Return value must be of type: String public static string test { get { return User.FirstName; } } // Compiler error: Incompatible types since an instance of Schema.SObjectField is never an instance of String public static string test { get { return (string)User.FirstName; } } // Compiles but always returns 'FirstName' public static string test { get { return User.FirstName + ''; } } // Compiler error: expecting a semi-colon, found ':' public static string test { get { return :User.FirstName; } } // Compiler error: line 33:10 no viable alternative at character '$'
public static string test { get { return $User.FirstName; } } Surely there is a way to do this? Thanks! Hi, I've uploaded some images to: \staticresources\images\codename\foo.jpg \staticresources\images\codename\bar.jpg So I found$Resources, but the docs don't really answer how to reference images in subfolders.  How can I use URLFOR and \$Resources to get the path to these images?

Once I get an answer to that question, I have a followup... do I have to use <apex:image> instead of using <img> with the URLFOR to render an image?  If not, what is the advantage of using <apex:image> over <img>?

Thanks!