+

Search Tips   |   Advanced Search

Modify the static template of the theme


Dynamic content spots start the combiner data source which injects markup necessary to load all of the modules identified in the module profile. To start modularizing the theme, create two dynamic content spot references in the static template for the theme to create references to load modules.

Important: Enable development mode before copying the static resources for the theme. For more information, see Administering the theme modularization framework. If you do not enable development mode, be sure to restart the portal server before using the copied theme. The following steps presume you first migrated the Page Builder-based theme to a Portal 8.0 server.

  1. Connect the WebDAV client, such as WebDrive or AnyClient, to...

      http://host:port/wps/mycontenthandler/dav/fs-type1

  2. From the themes\<yourTheme>\nls folder, copy the theme template file, theme_en.html or whichever file is the default locale, to the local drive and edit it. Repeat for any of the other locale files for the languages to support.

    You do not need to modify the theme.html file in the themes\<yourTheme> folder. It is only used to redirect to the appropriate locale file in the nls folder. Modify it only when we add or remove locales.

    1. Add the following line to the <head> section of the template for the theme.

        <link rel="dynamic-content" href="http://setgetweb.com/p/portal80/co:head">

    2. Add the following line to the <body> section before the config.jsp link:

        <a rel="dynamic-content" href="http://setgetweb.com/p/portal80/co:config"></a>

    3. Add the following lines as the first thing inside the <body> tag before the lotusFrame <div>:
       <!-- iWidgets will fill in the two empty divs below -->
       <div id="customizeShelfContainer"></div><!-- used by the mm_customize_shelf module -->
       <div id="pageToolbarButtons"></div><!-- used by the mm_page_toolbar module -->
      
      This section activates some of the new modules.

    4. Remove the following code blocks that are no longer needed by modules:
      <!-- pb-pageMode-edit indicates that an iwidget should be lazy-loaded upon entering edit mode for the page -->
      <div class="iw-iWidget iw-Standalone pb-pageMode-edit" id="customizeShelfContainer">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/customizeShelf.xml?pragma=cache&amp;max-age=1209600&amp;
        cache-scope=public&amp;vary=none&amp;user-context=false">
       </a>
      </div>
      
      <div class="iw-iWidget iw-Standalone" id="templateLayout">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/templateLayout.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
      </div>
      
      <div class="iw-iWidget iw-Standalone" id="templateLayout">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/templateLayout.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
      </div><div class="iw-iWidget mumHiddenWidget iw-Standalone pb-pageMode-edit" id="newPage">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/NewPageDialog.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
       <span class="iw-ItemSet" style="display:none" >
        <a class="iw-Item" href="http://setgetweb.com/p/portal80/#controller">ibmCfg.controllers.navigation</a>
        <a class="iw-Item" href="http://setgetweb.com/p/portal80/#allowFriendlyURL">true</a>
        <a class="iw-Item" href="http://setgetweb.com/p/portal80/#allowPrivate">true</a>
        <a class="iw-Item" href="http://setgetweb.com/p/portal80/#showPageTemplate">ibmPortalConfig.isContentTemplatingEnabled</a>
       </span>
      </div>
      <!-- The lazyLoad attribute is used for widgets that are explicitly loaded by another source at a later point in time 
           (in this case the displayHelper). -->
      <div class="iw-iWidget mumHiddenWidget iw-Standalone" lazyLoad="true" id="sharePage">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/accessControl.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
      </div>
      <div class="iw-iWidget mumHiddenWidget iw-Standalone" lazyLoad="true" id="reorderPage">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/reorderPageWidget.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
      </div>
      <div class="iw-iWidget mumHiddenWidget iw-Standalone" lazyLoad="true" id="viewMorePage">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/viewMorePage.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
      </div>
      <div class="iw-iWidget mumHiddenWidget iw-Standalone" lazyLoad="true" id="wireInterface">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/wireInterfaceWithSettings.xml?pragma=cache&amp;max-age=1209600&amp;
        cache-scope=public&amp;vary=none&amp;user-context=false">
       </a>
       <span class="iw-ItemSet"  style="visibility: hidden; display: none">
        <a class="iw-Item" style="visibility:hidden;display:none;" href="http://setgetweb.com/p/portal80/#displaySettings">true</a>
        <a class="iw-Item" style="visibility:hidden;display:none;" href="http://setgetweb.com/p/portal80/#displayPortletsAndWidgetsWarningMessage">true</a>
       </span>
      </div>
      <div class="iw-iWidget mumHiddenWidget iw-Standalone pb-pageMode-edit" id="autoWiringManager">
       <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/autoWiringManager.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
      </div>
      <div class="iw-iWidget iw-Standalone" id="dialogDisplayer">
       <a class="iw-Definition" style="visibility:hidden;display:none;" 
        href="http://setgetweb.com/p/portal80//mccbuilder/widget-catalog/displayHelper.xml?pragma=cache&amp;max-age=1209600&amp;cache-scope=public&amp;
        vary=none&amp;user-context=false">
       </a>
       <span class="iw-ItemSet"  style="visibility: hidden; display: none;">
        <a class="iw-Item" style="visibility:hidden;display:none;" href="http://setgetweb.com/p/portal80/#sharePage">sharePage</a>
        <a class="iw-Item" style="visibility:hidden;display:none;" href="http://setgetweb.com/p/portal80/#reorderPage">reorderPage</a>
        <a class="iw-Item" style="visibility:hidden;display:none;" href="http://setgetweb.com/p/portal80/#viewMorePage">viewMorePage</a>
        <a class="iw-Item" style="visibility:hidden;display:none;" href="http://setgetweb.com/p/portal80/#wireInterface">wireInterface</a>
        <a class="iw-Item" style="visibility:hidden;display:none;" href="http://setgetweb.com/p/portal80/#autoWiringManager">autoWiringManager</a>
       </span>
      </div>
      

    5. Change all instances of /mccbuilder/widget-catalog to /wps/mccbuilder.v3001/widget-catalog to get the latest Builder widgets.

  3. Save the local copy of the file and copy it into the corresponding location in WebDAV.

  4. From the themes\<yourTheme>\js folder, copy the init.js file to local drive and edit it.

    1. Remove the following code blocks that are no longer needed by modules:
      lgr.trace(mname, "Adding live text config entries for decorations and semantic tagging");
      /* Add live text service configuration entries for layout control decorations and semantic tagging */
      var livetextEntryAdded = "/com/ibm/mashups/livetext/configentryadded";
      var decorationsEntry = new com.ibm.mashups.livetext.ConfigEntry("*.component-control", true, "com.ibm.pb.decorations", 
        ibmConfig["com.ibm.mashups.contextroot.builder"]+"/js/com/ibm/pb/decorations","com.ibm.pb.decorations.DecorationManager", true);
      var configEntryAction = new com.ibm.mashups.livetext.ConfigEntry(".com\\.ibm\\.portal\\.action", false, "portallof",    
        "/wps_semanticTag/javascript",  "portallof.vcard",  false, "com.ibm.portal.action");
      var configEntryVCard = new com.ibm.mashups.livetext.ConfigEntry(".vcard", false, "portallof","/wps_semanticTag/javascript",  
        "portallof.vcard",  false, "hcard");
      var configEntryC2aSourceTarget = new com.ibm.mashups.livetext.ConfigEntry(".c2a\\:source,.c2a\\:target", false, "portallof", 
        "/wps_semanticTag/javascript", "portallof.vcard", false, "c2a");
      dojo.publish(livetextEntryAdded,[decorationsEntry]);
      dojo.publish(livetextEntryAdded,[configEntryAction]);
      dojo.publish(livetextEntryAdded,[configEntryVCard]);
      dojo.publish(livetextEntryAdded,[configEntryC2aSourceTarget]);
      
      livetextService = com.ibm.mashups.services.ServiceManager.getService(com.ibm.mashups.livetext.ServiceModel.SERVICE_NAME);
      TagService = SemTagSvc = livetextService;
      (function(){
      var onTagContentChanged = livetextService.onTagContentChanged, onTagChanged = livetextService.onTagChanged;
      livetextService.onTagChanged = function() {
      var mp = com.ibm.mashups.enabler.io.XHRMultipartFactory.create();
      mp.startTransaction();
      onTagChanged.apply(this, arguments);
      mp.endTransactionDeferred(true).start();
      };
      livetextService.onTagContentChanged = function() {
      var mp = com.ibm.mashups.enabler.io.XHRMultipartFactory.create();
      mp.startTransaction();
      onTagContentChanged.apply(this, arguments);
      mp.endTransactionDeferred(true).start();
      };
      })();
      

    2. Add the following line of code as the last line inside the closing brace (}) of the dojo.addOnLoad(function(){...}); block:
      ibmCfg.controllers.navigation.onRefreshNavigation();
      

  5. Save the local copy of the file and copy it into the corresponding location in WebDAV.


Parent: Making a modularized theme
Related:

Connect to the Portal WebDAV