AnsweredAssumed Answered

Customizing the aikau search placeholder

Question asked by iwkse on Nov 13, 2016
Latest reply on Dec 13, 2017 by sharix

I have this problem with customizing the aikau search placeholder. I've created a share amp with maven and setting the extension like this to extend the SearchBox widget:

 

<extension>
   <modules>
      <module>
          <id>Aikau SearchBox Customization</id>
          <version>1.0</version>
          <auto-deploy>true</auto-deploy>
          <configurations>
              <config evaluator="string-compare" condition="WebFramework" replace="false">
                 <web-framework>
                     <dojo-pages>
                      <packages>
                            <package name="header" location="js/header"/>
                       </packages>
                     </dojo-pages>
                   </web-framework>
                 </config>
               </configurations>
            </module>
        </modules>
</extension>

 

with the structure in META-INF:

 

▾ js/
   ▾ header/
       ▾ i18n/
          SearchBox.properties
       SearchBox.js

 

having SearchBox.js:

 

define(["dojo/_base/declare", "alfresco/header/SearchBox"],
    function(declare, SearchBox) {
           return declare([SearchBox], {
               i18nRequirements: [ {i18nFile: "./i18n/SearchBox.properties"} ],
           });
});

 

and the properties file:

 

search.instruction=he who seeks shall find, Seek and ye shall find 

 

Any idea why the properties is not overridden?

 

[edit]

Never mind..I just find it out. Last time I was searching this aikau didn't allow to override the placeholder but this is been added! Thanks Dave Draper !

 

No need now to extend the widget but it's enough to set a customization extension and modify like:

 

var searchBox = widgetUtils.findObject(model.jsonModel.widgets, "id", "HEADER_SEARCH");
searchBox.config.placeholder= "search-custom.label";

Outcomes