solved How to add items to the 'user dropdown' menu that members see under username after login?

researchcooperative
@researchcooperative
8 years ago
694 posts
I am now wanting to add an item (a link to a custom form) to the 'user dropdown' menu that members see after login.

How can I do this?

When I search for 'user dropdown' in the support forums, I do not see anything that obviously deals with this matter.

Thanks, Peter


--
PJ Matthews, Kyoto
Migrated from Ning 2.0. Now at Jamroom 6 beta and using Jamroom Hosting for The Research Cooperative (researchcooperative.org)

updated by @researchcooperative: 08/24/17 12:09:47PM
michael
@michael
8 years ago
7,805 posts
You mean this menu? (screenshot)

That menu is mainly there to allow modules to add menu items to. So if you're thinking to do it from a module, then the code is:
    // Skin menu link to 'following'
    $_tmp = array(
        'group' => 'user',
        'label' =>  'Profiles You Follow'
        'url'   => 'following'
    );
    jrCore_register_module_feature('jrCore', 'skin_menu_item', 'jrFollower', 'following', $_tmp);
^^ code taken from the jrFollowers module's _init() function in include.php.

You'd do the same from your module.

Purpose of it is to allow modules to add themselves to the skin without the need for the owner of the skin to do any customization to get the module to work.

--
If you're wanting to add a static item onto the end or the beginning of that, you can do it without building a module by customizing the menu.tpl file in your skin.
/skins/(YOUR SKIN)/menu.tpl

It probably looks like this
{foreach $_items as $entry}
    {assign var="oc" value=""}
    {if isset($entry.menu_onclick) && strlen($entry.menu_onclick) > 2}
        {assign var="oc" value=" onclick=\"`$entry.menu_onclick`\" "}
    {/if}
    {if isset($entry.menu_function_result) && strlen($entry.menu_function_result) > 0}
        {if is_numeric($entry.menu_function_result)}
            <li><a href="{$entry.menu_url}" {$oc}>{$entry.menu_label} [{$entry.menu_function_result}]</a></li>
        {else}
            <li><a href="{$entry.menu_url}" {$oc}>{$entry.menu_label} <img src="{$entry.menu_function_result}" alt="{$entry.menu_label}"></a></li>
        {/if}
    {else}
        <li><a href="{$entry.menu_url}" {$oc}>{$entry.menu_label}</a></li>
    {/if}
{/foreach}

so if you add another LI at the end it will show up in the menu
 <li><a href="https://jamroom.net">A link to Jamroom.net</a></li>
menu_items.jpg
menu_items.jpg  •  33KB

douglas
@douglas
8 years ago
2,806 posts
You can also use the User Menu Editor found in your ACP > Core > System Core > Tools.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
researchcooperative
@researchcooperative
8 years ago
694 posts
Hi, that looks like it might be simple. I created a custom form setting out the options for account deletion (three different ways). That gave me a template name.

Then I went to the User Menu Editor, and found that I need to enter a URL for a new menu entry. My custom form does not have URL.

What should I do next?


--
PJ Matthews, Kyoto
Migrated from Ning 2.0. Now at Jamroom 6 beta and using Jamroom Hosting for The Research Cooperative (researchcooperative.org)
douglas
@douglas
8 years ago
2,806 posts
If you used the custom form module to create your form then your custom form will have an URL like form/name_of_custom_form.

That would be the URL you would want to use.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
researchcooperative
@researchcooperative
8 years ago
694 posts
Thanks - that worked.

Knowing that the URL exists, I went back to:

ACP>Forms>Simple Custom Forms>Form Browser>View Form

...and found that by clicking on the form name in the View Form column, my newly created form and its URL can be seen and the URL copied from there.

I am using a simple custom form to provide advice on options for leaving my network, and a way for logged in members to act on that advice by stating their choice in the form, and posting it.

See thread here: /the-jamroom-network/forum/using-jamroom/52134/how-to-leave-how-to-delete-or-how-to-remove-own-account.

I'll call the present thread solved, and the Forms module great!


--
PJ Matthews, Kyoto
Migrated from Ning 2.0. Now at Jamroom 6 beta and using Jamroom Hosting for The Research Cooperative (researchcooperative.org)

updated by @researchcooperative: 05/25/17 06:10:48AM