Skip to end of metadata
Go to start of metadata

Copying comments from doco page to start new forum topic:

Unknown User (agehl) Apr 22

Hi,

is it possible to add my-communities as items of a menu?
It seems approximately works if I do that :

{menu}Communities
{my-communities:showLogo=true|showControls=false|showCommonMembership=false|showRole=false|showDescription=false}
{menu}

Is it the good way or there is another solution to do that?

Thanks.

Unknown User (scayla) 29 July

I found a kind of work-around to this issue which (to my suprise) has not been asked in the forum or I didn't find the topic.
I'll post my solution here, feel free to move this post anywhere else.

After looking at this doc about menu customization(customiSation looks like a french word btw (wink)), I created a page called mycommunities in which I wrote the macro :
{my-communities:showLogo=false|showControls=false|showCommonMembership=false|showRole=false|showDescription=false}

The output of the macro contains a div which breaks the output as a menuitem when Builder manipulates it. So, I removed the div container which contained the list in the my-community.vm file in the plugin. (adding the file then in /WEB-INF/classes/templates/bubbles/communities)

Then, I added the following in my Builder menu
{wikimenu}{import:mycommunities}{wikimenu}

Works like a charm (smile)
Shanon you could consider an option to output the {my-communities} macro for it to help Builder build the menu easily. What do you think about that ?

Cheers

[Edit] Actually there is no need to create a page and import it. Just putting the macro between the {wikimenu} markup does the trick. [Edit]

  • No labels

6 Comments

  1. Unknown User (skrebs)

    I'm open to suggestions on how you think this should be implemented? Do you just want to see the community-header div gone based on a param, or are there other changes you have made as well?

    Also slightly related, in the next point release of the plugin there is an update to the macros that use this template so they each get their own template (but still just parse the common one by default: BUBBLES-373)

    1. Unknown User (scayla)

      I've just tested the {wikimenu} macro with a list like this

      And it displays the image just like a menuicon. I don't know if the community logo could be used as an icon if "superminimized" but it could be a good feature. As so, the logo of the community should also be listed but not inside a link otherwise it would be interpreted by Builder as the link of the list instead of the real link which is the name of the community.

      So, to answer your question, I would put a parameter called "menu". If this parameter is set to true, the my-community macro outputs a very simple list (and no need to specity all the other parameters to avoid displaying informations about communities if this parameter is set to true...let's imagine ^^). If used in conjunction with the showLogo parameter set to true, each item of the list will contain the image community logo prior to the link to the community to make it become an icon for the menu.

      1. Unknown User (skrebs)

        I created an improvement issue for this here: BUBBLES-375.

        I'll upload a SNAPSHOT build there soon, feel free to test it out, or provide a patch for the template file etc.

        1. Unknown User (scayla)

          Wow just awesome ! What a really fast response time !
          You even considered the showLogo parameter for the icon and it simply works great !
          Thanks a lot Shannon !

  2. Unknown User (gfraser)

    As a temporary work around, you can use something like this (from vague memory):

    {menubar:....}
     {menu}My communities
       {menuitem}
         {div}{my-communities}{div}
       {menuitem}
     {menu}
    {menubar}
    

    I'm pretty sure adding a div around the contents of a menuitem allows a block of arbitrary content to be embedded in to a menu. If it doesn't work, it would be worth asking in the theme builder forum as someone there will have likely done it before.

    @Shannon - a 'list' mode for that macro (and any other macros that generate lists) should allow easy inclusion in to Builder menus. Possibly a 'menulist' mode which omits the outer <ul> tags would help as you wouldn't need to use the wikimenu macro to strip the <ul> tags = faster performance.

    1. Unknown User (scayla)

      Well, after trying to make it work for the communities macro (also), this doesn't really work the way you say Guy. I didn't clearly dig to find the right way to do this without the wikimenu macro, but as the communities "like" macros use the same template for now (mycommunities.vm) and thanks to Shannon modification in the 1.5.2 release, I could also use the display=menu parameter to get the right output for the communities macro.

      Thanks anyway (smile)