cancel
Showing results for 
Search instead for 
Did you mean: 

Including a sub-component inside the document library

douglascrp
World-Class Innovator
World-Class Innovator
Hello.

I'm trying to develop a custom code which looks almost like the same idea described on this blog post https://www.alfresco.com/blogs/developer/2011/09/02/auto-readme-extension-example/

What I have to do is find how to make my sub-component to be placed between the toolbar and the doclist, just like the readme div show at the post's images.

I've tried to se the set the component using no index, and several values to the index property, but all I got is the sub-component placed before the toolbar or after the doclist.

The config I'm using is:


<module>
            <id>Exibe pendencias prontuario</id>
            <auto-deploy>true</auto-deploy>
            <components>
                <component>
                    <scope>template</scope>
                    <region-id>documentlist_v2</region-id>
                    <source-id>documentlibrary</source-id>
                    <sub-components>
                        <sub-component id="Pendencias_Prontuario" index="1">
                            <url>/blog/demo/new-content</url>
                        </sub-component>
                    </sub-components>
                </component>
            </components>
        </module>
1 ACCEPTED ANSWER

douglascrp
World-Class Innovator
World-Class Innovator
I've finally found the solution.

The problem was that I was not including the escope option.

The working code:

<@markup id="custom-documentListContainer" target="documentListContainer" action="after" escope="global">
    <div id="pendencias_prontuario">
            Pendências aqui!!!
    </div>
</@>

View answer in original post

2 REPLIES 2

douglascrp
World-Class Innovator
World-Class Innovator
After talking with Axel, I changed the idea to try to include the new <div> inside the <@markup id="documentListContainer">, which is defined in the documentlist_v2.lib.ftl file.

I tried lots of ideas, but I couldn't find the right way to accomplish what I need.

Can anyone please try to point me to the right direction on how to solve this?
I can't accept that such a small change is so hard to achieve.
The only thing I can imagine is that it is my fault.

The idea is to simply include a div between the toolbar and the doclist, and I want to be able to show some custom "status message" on that div.

I tried to create an extension module:

<module>
    <id>Custom document library</id>
    <customizations>
        <targetPackageRoot>org.alfresco.components.documentlibrary</targetPackageRoot>
        <sourcePackageRoot>br.com.dgcloud.components.documentlibrary</sourcePackageRoot>
    </customizations>
</module>


And I tried to change the freemarker template by extending both documentlist-v2.get.html.ftl and documentlist_v2.lib.ftl.

My attempts so far:

<@markup id="custom-documentListContainer" target="documentListToolbar" action="after">
    <div id="pendencias_prontuario">
            Pendências aqui!!!
    </div>
</@>


<@markup id="custom-documentListContainer" target="documentListContainer" action="after">
    <div id="pendencias_prontuario">
            Pendências aqui!!!
    </div>
</@>


and even

documentListContainer

<@markup id="custom-documentListContainer" target="html" action="after">
    <div id="pendencias_prontuario">
            Pendências aqui!!!
    </div>
</@>


Nothing seems to work.

douglascrp
World-Class Innovator
World-Class Innovator
I've finally found the solution.

The problem was that I was not including the escope option.

The working code:

<@markup id="custom-documentListContainer" target="documentListContainer" action="after" escope="global">
    <div id="pendencias_prontuario">
            Pendências aqui!!!
    </div>
</@>