cancel
Showing results for 
Search instead for 
Did you mean: 

Remove 'Documents' Site Tree

justin_haney
Champ in-the-making
Champ in-the-making
Hey guys, attaching a picture so you see what I mean:

[img]http://i.imgur.com/Ocw3n.png[/img]

I need to remove that entire menu completely from view, just hiding it is fine, is there a way to do that?
9 REPLIES 9

jordiv
Champ on-the-rise
Champ on-the-rise
Hi,

If you just want to hide it, you can try editing the CSS file of your template.
If you are using the default template, the file you should edit would be:

<ALF_HOME>/tomcat/webapps/share/themes/default/presentation.css
For example, you could add the following CSS code:

#alf-filters {
    display: none;

}

#alf-content {
    margin-left: 0px !important;
}

Although I don't think this is the best way to do this.


Cheers,
Jordi.

loftux
Star Contributor
Star Contributor
If you are on version 4, you can do this with Surf Extension
In folder shared/classes/alfresco/site-data/extension add xml file removefilters.xml (can be named anything)
<extension>
   <modules>
      <module>
         <id>My DocumentsFilterRemoval</id>
         <components>
            <component>
               <region-id>filter</region-id>
               <source-id>documentlibrary</source-id>
               <scope>template</scope>
               <sub-components>
                  <!– Remove filters –>
                  <sub-component id="default">
                     <evaluations>
                        <evaluation id="hidefilters">
                           <render>false</render>
                        </evaluation>
                     </evaluations>
                  </sub-component>
               </sub-components>
            </component>
         </components>
      </module>
   </modules>
</extension>
Restart, and then go to http://localhost:8080/share/page/modules/deploy and deploy your changes.
You can read more about this at
http://blogs.alfresco.com/wp/ddraper/category/alfresco/

justin_haney
Champ in-the-making
Champ in-the-making
Thanks for the quick response! This was almost what I wanted! basically I am trying to remove the "Documents" category which has I'm Editing, Recently Modified, etc etc, but keep "Library" and "Tags"

jordiv
Champ on-the-rise
Champ on-the-rise
If you followed the steps described in my previous post, then the code you should put in presentation.css would be:

div.doclib-filter {
    display: none;
}


Cheers,
Jordi.

justin_haney
Champ in-the-making
Champ in-the-making
Hi Jordi, I am attaching another pic of what I mean, the code that you example removes the library menu too, I do not want that.

[img]http://i.imgur.com/dHKlx.png[/img]

Thanks again and sorry if original post wasn't as specific!

jordiv
Champ on-the-rise
Champ on-the-rise
Did you remove the CSS code from the first post?
You should remove it from the presentation.css file and only add the code in the second post. And make sure your browser's cache gets refreshed when you change the CSS styles.

I've tried it and for me it works as you described (version 3.4.d).


Cheers,
Jordi.

loftux
Star Contributor
Star Contributor
Do it this way instead for pre 4.0 Alfresco.
Find the file tomcat/webapps/share/WEB-INF/classes/alfresco/templates/org/alfresco/documentlibrary.ftl
Make a copy in tomcat/shared/classes/alfresco/web-extension/templates/org/alfresco/documentlibrary.ftl
In your copy, remove
<@region id=doclibType + "filter" scope="template" protected=true />
Then restart Share server.

No need to mess around with css. Instead you are customizing the share surf page, and what components it will render.

justin_haney
Champ in-the-making
Champ in-the-making
Did you remove the CSS code from the first post?
You should remove it from the presentation.css file and only add the code in the second post. And make sure your browser's cache gets refreshed when you change the CSS styles.

I've tried it and for me it works as you described (version 3.4.d).


Cheers,
Jordi.

Brilliant, that works perfect. Thanks so much! Thanks to Loftux as well, I am going to do what you said once we upgrade to 4.x in the future!

erikwinlof
Confirmed Champ
Confirmed Champ
Even though the .css solution works, it will still perform tasks in the background, such as unnecessarily loading the ajax the document tree in the background and thus adds unnecessary requests on the server (even thoughts its not visible to the user). It also means you have to mess with the original source code which you want to avoid as much as possible.

So for a 3.4 server I would suggest that create an "empty" web script that displays "nothing", then you can replace Share components with this empty component to hide stuff.

To do that, just create the following files and restart the server:

${TOMCAT}/shared/classes/alfresco/web-extension/site-webscripts/acme/components/empty.get.desc.xml
<webscript>
  <shortname>Acme Empty</shortname>
  <description>Used to hide components.</description>
  <url>/acme/components/empty</url>
</webscript>

${TOMCAT}/shared/classes/alfresco/web-extension/site-webscripts/acme/components/empty.get.html.ftl
<!– nothing–>

${TOMCAT}/shared/classes/alfresco/web-extension/site-data/components/template.filter.documentlibrary.xml
<?xml version='1.0' encoding='UTF-8'?>
<component>
   <scope>template</scope>
   <region-id>filter</region-id>
   <source-id>documentlibrary</source-id>
   <url>/acme/components/empty</url>
</component>

This last file is the config that replaces the original "Documents" component with the "empty" component. To replace a component with the "empty" component you must in other words know the "scope", "region-id" & "source-id". If you're running one of the latest 3.4.x releases (such as 3.4.d) you can find these values by using SurfBug, simply follow these steps to identify the values:

1. Visit http://localhost:8081/share/page/surfBugStatus (login as admin if requested)
2. Click "Enable SurfBug".
3. Navigate to the page on which you want to hide a component. (You will now see red borders around each component).
4. Click on a component (you will now see a black popup displaying details about the component).
5. Look under "Component details" there you will be able to see the 3 values your looking for.

So to replace another component, just find the 3 values and insert them into:

${TOMCAT}/shared/classes/alfresco/web-extension/site-data/components/{scope}.{region-id}.{source-id}.xml
<?xml version='1.0' encoding='UTF-8'?>
<component>
   <scope>{scope}</scope>
   <region-id>{region-id}</region-id>
   <source-id>{source-id}</source-id>
   <url>/acme/components/empty</url>
</component>

PS. Loftux solution is the preferred way for a 4.0 server.
PS2. You can of course also package the files in .jar file and place it in shared/lib if you prefer that.