Whilst looking for a solution to do this I came across Sasank's page documenting how he achieved this, via injecting JavaScript and using JQuery.
The downside, at least for me, was implementing all of the other JavaScript to actually trigger the click event. What I really wanted was a native JavaScript solution, i.e. without any frameworks.
With Fluid pages it is now possible to inject JavaScript (and CSS) through Fluid specific PeopleCode events. There are quite a few different functions, which are documented here.
So we know that we can inject JavaScript into a Fluid component, and we also know that the NavBar is a Fluid component. So, can we use Event Mapping to inject the PeopleCode? The answer is yes we can.
Like any Related Content Framework PeopleCode, you need to:
- Create an Application Package PeopleCode class.
- Create a Service Definition with a URL Type of Application Class, and reference the class created above.
- And then map the PeopleCode to the Content Reference (Event Mapping).
The HTML referenced is as follows:
The component you map this your Service Definition to is found here (hidden by default so remember to check the 'Include Hidden CREFs' checkbox):
Given that this solution does the same thing as Sasank's solution, I did not add any extra screenshots showing the before and after. And whilst there probably are better ways of doing this, this is what I found working for me.
Credit for the JavaScript idea belongs to the post here.