Modification des références des ressources dynamiques pour votre thème

Modifiez les références des ressources dynamiques de manière à pouvoir établir un lien vers les ressources statiques de votre thème.

Pourquoi et quand exécuter cette tâche

Les zones de contenu dynamique sont définies par l'intermédiaire d'un module appelé wp_dynamicContentSpots_85. The module is defined in the plugin.xml file, which was copied when you copied your theme.

Procédure

  1. Ouvrez le fichier plugin.xml à partir du projet CustomThemeDynamic que vous avez créé lorsque vous avez copié vos ressources de thème dynamiques.
  2. Editez les ID et nom avec des noms personnalisés uniques. Utilisez des ID de plug-in personnalisés avec le préfixe de votre nom de société pour vous assurer que vos fichiers WAR seront bien invalidés. Le bloc de code suivant illustre un exemple :
    <?xml version="1.0" encoding="UTF-8"?>
    <plugin id="com.yourcompany.customtheme" name="Custom Theme Modules provider-name="Your Company" version="1.0.0">
    
    <extension id="wp_dynamicContentSpots_custom" point="com.ibm.portal.resourceaggregator.module">
       <module id="wp_dynamicContentSpots_custom">
          <contribution type="dyn-cs">
             <sub-contribution type="markup" ref-id="customtheme_footer">
                <uri value="res:{war:contextroot}/themes/html/dynamicSpots/footer.jsp"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_crumbTrail">
                <uri value="mvc:res:{war:contextroot}/themes/html/dynamicSpots/crumbTrail.jsp,smartphone@"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_topNav">
                <uri value="mvc:smartphone/tablet@res:{war:contextroot}/themes/html/dynamicSpots/navigation.jsp?type=top"/>"
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_primaryNav">
                <uri value="mvc:res:{war:contextroot}/themes/html/dynamicSpots/navigation.jsp?type=primary,smartphone@,tablet@"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_secondaryNav">
                <uri value="mvc:res:{war:contextroot}/themes/html/dynamicSpots/navigation.jsp?type=secondary,smartphone@,tablet@"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_sideNav">
                <uri value="mvc:res:{war:contextroot}/themes/html/dynamicSpots/sideNavigation.jsp?startLevel=2,smartphone@,tablet@"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_mobileNav">
                <uri value="mvc:smartphone/tablet@res:{war:contextroot}/themes/html/dynamicSpots/mobileNavigation.jsp"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_commonActions">
                <uri value="res:{war:contextroot}/themes/html/dynamicSpots/commonActions.jsp"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_layout">
                <uri value="lm:template"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="85theme_toolbar">
                <uri value="mc:wp_toolbar85@mvc:dyn-cs%3Aid%3A85toolbar%2Csmartphone%40%2Ctablet%40"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_head">
                <uri value="res:{war:contextroot}/themes/html/dynamicSpots/head.jsp"/>
             </sub-contribution>
             <sub-contribution type="markup" ref-id="customtheme_status">
                <uri value="mc:wp_status_bar@res:{war:contextroot}/themes/html/dynamicSpots/status.jsp"/>
             </sub-contribution>
          </contribution>
       </module>
    </extension>
  3. Accédez au projet CustomThemeStatic que vous avez créé lorsque vous avez copié votre thème statique et vos ressources d'habillage.
  4. Modifiez les profils pour votre thème personnalisé afin d'inclure le module dans votre fichier plugin.xml.
    1. A partir du dossier WebContent/themes/customTheme/profiles, éditez chaque fichier de profil.
    2. Remplacez le module wp_dynamicContentSpots_85 par le module wp_dynamicContentSpots_custom que vous avez créé lorsque vous avez modifié le fichier plugin.xml.
    3. Sauvegardez vos modifications.
  5. From the WebContent/themes/customTheme/profiles/nls folder, edit the theme_en.html file (or whichever file is your default locale) on your local drive. Répétez l'opération pour les autres fichiers d'environnement d'environnement local correspondant aux langues que vous prenez en charge.
  6. Dans les fichiers theme_lang.html, recherchez et remplacez toutes les occurrences de 85theme par customtheme. Par exemple, dyn-cs:id:85theme_head devient dyn-cs: id:customtheme_head.
  7. Sauvegardez vos modifications.