cancel
Showing results for 
Search instead for 
Did you mean: 

Setting vars for a user's home folder in share-custom-config

patorjk
Champ in-the-making
Champ in-the-making
I'm trying to change the Repository link in the header of Share to point to a users home folder. For example, instead of linking to "/share/page/repository", it'd link to "/share/page/repository#filter=path|/User%2520Homes/g/gi/gillespie/patrick.j.gillespie". I should note I'm using a home folder provider, which is why the user home isn't directly under "User Homes".

I can modify the link via the share-config-custom.xml file, by modifying this line:

<item type="link" id="repository">/repository</item>

However, I'm unaware of how to get the path of a user's home folder from here. I noticed there are several values such as {userid} and {pageid} that are referenced, but I'm not sure where or how to create such a value. Does anyone know how I would do this?
3 REPLIES 3

bengrah
Champ on-the-rise
Champ on-the-rise
Hi patrojk

I do something similar on my instance, where I've got a header link to the logged in user's home folder, here's my markup:

<item type="link" id="my-workspace" label="header.my-workspace.title" description="header.my-workspace.description" icon="replication-jobs.png">/repository#filter=path|/User%2520Homes/{userid}</item>

I've got my own label and descriptions in place, and I use the replication-jobs.png for the icon (it's just one folder in front of the other but I think it works). Then the path itself.

Hope that helps.

Cheers,
Ben.

patorjk
Champ in-the-making
Champ in-the-making
Hi Ben,

Thanks for the response. Unfortunately, my case is a bit of an outlier, since I'm using a custom home folder provider which causes there to be a structure under the "User Homes" directory based on the user's last name and username. For example, this could be a possible home folder:

/User%2520Homes/g/gi/gillespie/patrick.j.gillespie

I was able to get around this problem by creating a web script to get the home folder path (based on a username) and then dynamically updating the link on the client side (by adding some code to the "alfresco-template.ftl" file), but I'm not sure if this is the best solution.

bengrah
Champ on-the-rise
Champ on-the-rise
Hi patrojk,

That sounds like a good enough solution. Another method you could possibly use is try and emulate how Alfresco currently creates the link, by creating your own template.

If you take a look in webapps/share/js/alfresco.js, and do a find on "userprofilepage" you'll see some references on how the userprofilepage link is created. I don't know enough of where to go about creating your own, but perhaps it's a starting point. As ideally what you could do is create a template which renders your user home link in the style that you have customised so far (/g/gi/gillespie/partrick.j.gillespie)