Customizing Captions via the Extras.xml File

,

Each ExtensionName value in the WMAppManifest.xml file is defined in an Extras.xml file. The Extras.xml file allows you to add custom captions for your app in the quick card, depending on the category of the search result; see Listing 31.2.

The Extras.xml file is composed of the following elements:

Image ExtrasInfoThe root element.

Image AppTitle(Used only in Windows Phone OS 7.1). Contains the default and localized strings representing the title of the application as it will appear in the apps pivot page. Only one AppTitle element is allowed.

Image ConsumerIDMust correspond to the search extensions value: 5B04B775-356B-4AA0-AAF8-6491FFEA5661.

Image ExtensionNameThe name of the extension associated with the caption specified in the CaptionString element. The extension listed here must also be listed in WMAppManifest.xml. Do not specify the same extension name in more than one ExtensionInfo element because it prevents your app from appearing on a quick card.

Image DefaultSpecifies the default and localized caption strings for the caption associated with the extension in the Extensions element.


Note

The AppTitle is relevant only to Windows Phone 7.1 apps and not Windows Phone 8 apps. For Windows Phone 7.1 apps, the AppTitle defines the title used in the app list. Conversely, for Windows Phone 8 apps, the title that is displayed is the value of the Title attribute of App element in the WMAppManifest.xml file.


LISTING 31.2. Extras.xml (excerpt)


<ExtrasInfo>

  <AppTitle>
    <default>WPUnleashed Search Extensibility</default>
    <fr-FR> WPUnleashed Extensibilité Recherche</fr-FR>
  </AppTitle>

  <!-- Search-related captions -->
  <Consumer ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5661}">

    <!-- Products caption for all product categories -->
    <ExtensionInfo>
      <Extensions>
        <ExtensionName>Bing_Products_Arts_and_Crafts</ExtensionName>
        <ExtensionName>Bing_Products_Baby_and_Nursery</ExtensionName>
        <ExtensionName>Bing_Products_Beauty_and_Fragrance</ExtensionName>
        ...
      </Extensions>
      <CaptionString>
        <default>Product URI Details</default>
        <fr-FR>Détails du produit URI</fr-FR>
      </CaptionString>
    </ExtensionInfo>

    <!-- Places caption for place categories -->
    <ExtensionInfo>
      <Extensions>
        <ExtensionName>Bing_Places_Arts_and_Entertainment</ExtensionName>
        <ExtensionName>Bing_Places_Automotive_and_Vehicles</ExtensionName>
        <ExtensionName>Bing_Places_Business_to_Business</ExtensionName>
        <ExtensionName>Bing_Places_Computers_and_Technology</ExtensionName>
        <ExtensionName>Bing_Places_Education</ExtensionName>
        ...
      </Extensions>
      <CaptionString>
        <default>Place URI Details</default>
      </CaptionString>
    </ExtensionInfo>

    <!-- Movies caption for all movie cards -->
    <ExtensionInfo>
      <Extensions>
        <ExtensionName>Bing_Movies</ExtensionName>
      </Extensions>
      <CaptionString>
        <default>Movie URI Details</default>
      </CaptionString>
    </ExtensionInfo>

  </Consumer>
</ExtrasInfo>



Note

A maximum of 50 captions can be specified in the Extras.xml file, for a maximum of 50 ExtensionInfo elements. Each ExtensionInfo element may contain no more than one ExtensionName element. The same CaptionString element (having the same caption text) can be used in more than one ExtensionInfo element, but an extension specified in an ExtensionName element cannot appear multiple times.



Note

The Extras.xml file can contain localized strings, so it must be UTF-8 encoded. All strings must be present within the file; strings cannot be referenced from a resource file.


With the Extras.xml file in place, a landing page can be defined to handle launching your app from a quick card.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.145.128