cancel
Showing results for 
Search instead for 
Did you mean: 

Default Document Library to Simple View

urshah
Champ in-the-making
Champ in-the-making
Is there a way to set the default in the document library of any site to the simple view?
can this be set per site or it universal for all sites?
9 REPLIES 9

mikeh
Star Contributor
Star Contributor
The change would be global, but the easiest way is to edit documentlist.get.html.ftl and change
simpleView: ${(preferences.simpleView!false)?string},
to
simpleView: ${(preferences.simpleView!true)?string},
Which will default it for all users unless they change the option themselves by clicking the toolbar button.

Thanks,
Mike

bremmington
Champ on-the-rise
Champ on-the-rise
Mike

In that template, what is the "preferences" object that's being referenced? Is there any way of altering its "simpleView" property rather than tweaking the template logic.


Regards
Brian

bremmington
Champ on-the-rise
Champ on-the-rise
Actually, I think I've found the answer to that question, but it raises another…

Share asks Alfresco (via a webscript invocation) for the logged-in user's preferences specifying a filter of "org.alfresco.share.documentList". The webscript calls the preferenceService and passes the results back in JSON format.

The new question is: how can I set the "org.alfresco.share.documentList.simpleView" preference for a person? Is there any UI for it at all?


Regards
Brian

bremmington
Champ on-the-rise
Champ on-the-rise
Me again…

I don't suppose anyone has a similar tip for the search results page?


Regards
Brian

mikeh
Star Contributor
Star Contributor
Hi Brian

Unfortunately, there's no UI to manage user preferences. However, you should be able to construct a POST request to the preferences REST API (at "api/people/{username}/preferences") with a JSON body containing the value to set, e.g.
{"org":{"alfresco":{"share":{"documentList":{"simpleView":true}}}}}

Edit: The search results don't support a simple view yet (it's on our list, but not near the top I'm afraid)

Does that help?
Mike

bremmington
Champ on-the-rise
Champ on-the-rise
Thanks, Mike. I'll write a little behaviour to make sure that that preference is set whenever a new person node appears.

Shame about the search results - I don't know if it's just me, but the detailed view always looks simply dreadful.


Regards
Brian

liviull
Champ in-the-making
Champ in-the-making
Anyone can advise how to setup simple View as default view for users system wide in 4.2.c?
The above solution seems to not be up to date anymore.

Appreciate your help

Cheers
Liviu

ddraper
World-Class Innovator
World-Class Innovator
The logic has been moved from the WebScript FreeMarker template into the JavaScript controller (this blog and those preceding/following it) explain why this has happened. Essentially you need to change the same property but you do it in the JavaScript controller and can now do this easily via an extension module.

ayushi_agrahari
Confirmed Champ
Confirmed Champ

Hi all,

I am also trying to making the default view to be simple view instead of detailed view and tried the above solution but I am not able to find the above configuration in documentlist.get.js file.

Instead,I tried to change the following in documentlist.get.js file

model.preferences.viewRendererName != null ? model.preferences.viewRendererName : "detailed",

to

       model.preferences.viewRendererName != null ? model.preferences.viewRendererName : "simple",

But it's not working

I have also tried to change the following in documentlist.js file

         viewRendererName:"detailed",

to

      viewRendererName:"simple"

but still the default view is appearing to be detailed view in document-library.

Any help would be greatly appreciated