In the process of customizing a mobile app created using Telligent Community Mobile, a new page/screen of content may be required. This guide walks through the steps of creating a new page and linking to that page from within a widget.
[toc]
Define the Page
Pages are defined within configuration files within the web server components of Telligent Community Mobile.
As an example, to create a welcome page, the following configuration file could be defined and placed within the Resources/ folder of the web server components of Telligent Community Mobile:
<resources> <pages> <page name="welcome" path="welcome"> <contentFragments> </contentFragments> </page> </pages> </resources>
Saving this example to a new file, Resources/welcome.xml, will add the welcome page to the application. The page named "welcome" is accessible by navigating to /welcome within the application (see "Linking to the Page" below for show to generate this link).
As defined, this page will have no content. This doesn't make the app unusable because the navigation panel and header are always present and provide a way for the user to navigate to other pages, but it also isn't useful. Normally, one or more widgets would be defined within the page.
Linking to the Page
Now that a page exists, the application should provide a way to navigate to the page. This is normally done within a widget. The mobile_v1_url widget extension can be used within a widget to link to pages.
To link to the welcome page created in the previous section, the following velocity script could be used within a widget's implementation:
$mobile_v1_url.FormatUrl('welcome')
This would render the URL of the welcome page. To make that a link, the following script could be used:
<a href="$core_v2_encoding.HtmlAttributeEncode($mobile_v1_url.FormatUrl('welcome'))"> Go to the welcome page </a>