Wrapper templates


Wrapper templates make up the base of every page. Every site must have a 'default' template. If you need different looks or uses for parts of your application you can create alternative wrapper templates.

Think of the wrapper as a combined footer and header for your application. Additionally, the separate wrappers can be created for text of HTML email formats. Common meta, CSS and JS information should be placed in your Wrapper. It controls everything except for the main content of a page.

A very basic example of a wrapper template:

<html>
  <head>
     <title>Walken.tv UGC site - {$$pageTitle}</title>
     {$cssLoader}
     <fm:Switch value="{$$basepage}">
        <fm:Case value="entry">
            <fm:FileInfo mid="{$$metaFields.id}">
                <meta name="description" content="{$media.message}" />
                <meta name="title" content="{$media.title}" />
            </fm:FileInfo>
        </fm:Case>
    </fm:Switch>
  </head>
  <body>
     <h1>Title</h1>
     {$content}
  </body>
</html>

Supported Attributes

NameDescription
application.facebook_app_id The Facebook App ID of the Application. This can be set in the "General" tab of the Application Settings page.
basepage The current base-page. For example: "home", "entry", "mediadetail".
content The main content of the page. The Application Template for the current page replaces this var.
cssLoader This spits out the link for the CSS stylesheet required for styling the application.
metaFields.id If the current page is a mediadetail page (Includes the module 'FMModule_MediaDetail') you can access the media ID of the current media using this var.
pageTitle The current page's title. This can be set in the Application Templates using the <fm:PageTitle> component.
subpage The current sub-page. For example, in "http://contest.projects.fm/entry/5467821" the sub-page is "5467821".
vhost The URL of the current Application. This var doesn't include the protocol. Remember to add "http://" before.
vhostid The vhost ID to which the Application belongs.

Depricated Attributes

NameDescription
htmlheaders This spits out the page meta tags, CSS loader path and glbal vars in the head of the page.


The wrapper templates in our system are:

  • default - required for any app, this will be your main template wrapper.
  • fbWrapper - a separate wrapper for apps used within modern Facebook pages/apps.
  • fbxd-wrapper - rarely used, this template is needed for older versions of Facebook Connect.
  • raw html - used to hold html formatted e-mails.
  • text only - used for text only e-mail templates.
  • xml - can be used to create rss feeds and site maps.

Creating a new Wrapper Template:

  • Hit the New Button
  • Fill the Template Name
  • Wrapper type: The options are XHTML/HTML, Plain Text, Strict XHTML (testing only), XUL and XML text.
  • Style Sheet: The default stylesheets are no stylesheet selected, comments, design, global and layout.
  • This will take you to a page called: example.projects.fm – name of application just created
  • On this page a moderator can put in their application code.

See Also: