Access Keys:
Skip to content (Access Key - 0)
Home (Access Key - 1)
All spaces... (Access Key - 3)
Log in (Access Key - 5)
Sign up (Access Key - 6)
Toggle Sidebar

how to have a menu title change based on user,group state (ala atlassians login,user menu)


I know in 3.2 we can pull out the 2.8 user menu, but I'd like to mimic that functionality currently. This is what I currently have:

{menubar:id=usr}
{menu}{builder-show:user=@anonymous}{compound-menuitem:login|icon=user1_into|caption=Log in}{builder-show}
{builder-show:group=@confluence-users}{compound-menuitem:profile|icon=id_card|caption=%user%}{builder-show}
{compound-menuitem:logout|icon=door2|caption=Log out}
{compound-menuitem:userspace|icon=document_heart|caption=Personal Space}
{compound-menuitem:history|icon=history2|caption=History}
{menu}
{menubar}

Shows up as no title. ^^

Toggle Sidebar
Added by Carl U on Jul 15, 2008 02:55, last edited by Carl U on Jul 15, 2008 02:55

You don't need the @ before a group name (confluence-users). The @anonymous is a special pseudo group (as there is no group in Confluence that contains anonymous users because, erm..., they are anonymous)



Updated by Carl U
Jul 23, 2008 19:18

Yeah, that jives with what I read in the documentation - just been scurrying around a lot recently and didn't notice i kept the @ from copy/pasting in.

It still doesn't make the item in question (whether it be a compound menu item or a simple li) appear in the topemnu of a menubar. Builder-show and builder-hide don't seem to work for first level menu items (e.g. log in vs profile link in confluence 2.8 ui).

This is what I'm using now, a log in link shows up to the left of the personal menu then disappears when logged in. It'd be nice to swap the login with logout once a user is logged in, or just do it confuence 2.8 style with one menu.

{menubar:id=usr}
{compound-menuitem:login|icon=user1_into|caption=Log in}
{menu}Personal Menu
{compound-menuitem:profile|icon=id_card|caption=Profile}
{compound-menuitem:userspace|icon=document_heart|caption=Personal Space}
{compound-menuitem:history|icon=history2|caption=History}
{compound-menuitem:logout|icon=door2|caption=Log out}
{menu}
{menubar}

debating whether to open an issue on it or not.

bumpity bump.

Something like this?

{builder-show:group=confluence-users} show to logged in people {builder-show}
{builder-hide:group=confluence-users} show to anon users {builder-hide}

I'm pretty sure there's a user=@anonymous param on the builder-show/hide macros, but Alain's not updated the docu. When he gets back from BOOM I'll get more info.


Adaptavist Theme Builder Powered by Atlassian Confluence