cancel
Showing results for 
Search instead for 
Did you mean: 

Customize Share Dashlet FTL

jpfi
Champ in-the-making
Champ in-the-making
Hi,
I'm trying to customize a html.ftl of an alfresco share dashlet (Alfresco 4.0.1 Ent):
site-data/extensions/fme-dashlets-extensions.xml:
<extension>
   <modules>
      <module>
         <id>FMEDashlet customizations</id>
         <customizations>
              <customization>
                  <targetPackageRoot>org.alfresco.components.dashlets</targetPackageRoot>
                  <sourcePackageRoot>de.fme.customization.dashlets</sourcePackageRoot>
              </customization>
          </customizations>
          <auto-deploy>true</auto-deploy>
      </module>
   </modules>
</extension>

webscripts\de\fme\customization\dashlets\my-sites.get.html.ftl:
<div>don't work</div>
webscripts\de\fme\customization\dashlets\my-sites.get.properties:
header=This works!

–> Customizing the messages is working as expected, but my custom my-sites.get.html.ftl is not used…Any hints?
Cheers,
jan
4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello Jan,

last I checked you needed a region / markup in the original FTL to hook into with your FTL customization in order for it to be picked up.

I.e. in the original


<div class="dashlet my-sites">
   <div class="title">${msg("header")}</div>
   <div class="toolbar flat-button">
   </div>
   <!– more HTML / FTL –>
   <@markup id="extPoint"></@markup>
</div>

and in the customization


<@markup id="myExt" target="extPoint" action="after">
   <!– custom HTML / FTL –>
</@markup>

Unfortunately, the base templates are not yet riddled with markups to hook into, so you usually have to either replace the entire component via sub-component URL evaluation or modify the original code a little bit.

Regards
Axel

cleseach
Star Contributor
Star Contributor
Hi Jan,

You should consider this page : http://docs.alfresco.com/4.0/topic/com.alfresco.enterprise.doc/tasks/tu-share-FM-temp-customize.html
To change the FTL, you should define a new component in your extension file.

Exemple :
<components>
        <component>
          <region-id>documentlist</region-id>
          <source-id>documentlibrary</source-id>
          <scope>template</scope>
          <sub-components>
            <sub-component id="default">
              <url>/fr/amexio/documentlirary/custom-documentlist</url>
              <properties>
                <pagination>true</pagination>
              </properties>
            </sub-component>
          </sub-components>
        </component>
      </components>

Regards,
Charles Le Seac'h

jpfi
Champ in-the-making
Champ in-the-making
Hi,
yub, but a component that is used as dashlet does not have a static region…it may be component-1-1, component-1-2 or component-2-1 …
There should be another solution than using the old file-replacement approach via web-extension to replace/extend another dashlet html.ftl

@Axel: yub,but adding a @markup to the original html.ftl ,copy the file to web-extension and then add a <customization> is also a little bit "dirty"

Cheers, Jan

afaust
Legendary Innovator
Legendary Innovator
Hence the "unfortunately"…
At the moment, I don't know of another solution to do this and I don't think there even is one. Adding the @markup to existing components is the next major task for Alfresco to make Share more customizable - they laid the foundation with the new Surf Extensibility feature, next up should be the scaffolding.

Regards
Axel