Add Link To My_Account_Menu That Calls A Form.

i'm unsuccessful in adding this link. The scenario is as follows:

We have a form called Test that we created. We want this form to be available as a link in the My account Dropdown and are trying to just and another item to the list tag. We will rename it once this works.

Because we need it in the menu, we created an override.tpl here because Pre and Post don't seem viable:

templates / addons / my_changes / hooks / profiles / my_account_menu.override.tpl

In the tpl, we copied the hook and pasted it in the override.tpl appending our line from:

templates / blocks / my_account.tpl

The copied code and appended form are:

{hook name="profiles:my_account_menu"}
{if $auth.user_id}
{if $user_info.firstname || $user_info.lastname}
  • {$user_info.firstname} {$user_info.lastname}
  • {else}
  • {$user_info.email}
  • {/if}
  • {__("profile_details")}
  • {if $settings.General.enable_edp == "Y"}
  • {__("downloads")}
  • {/if}
    {elseif $user_data.firstname || $user_data.lastname}
  • {$user_data.firstname} {$user_data.lastname}
  • {elseif $user_data.email}
  • {$user_data.email}
  • {/if}
  • {__("orders")}
  • {assign var="compared_products" value=""|fn_get_comparison_products}
  • {__("view_compare_list")}{if $compared_products} ({$compared_products|count}){/if}
  • I wouldn't use an override. I'd just use the "profiles:my_account_menu" hook and create a file

    addons/my_changes/hooks/profiles/my_account_menu.post.tpl

    and then have it contain something like:

  • __("lang_val_name_of_page")
  • Seems a lot simpler to me...

    We'll try that, thanks. The terminology is kind of weird. Post description makes it sound like it will happen AFTER the hook which seemed the

  • Thanks again for your reply.

  • Also note that the " symbol is used for some quotes in your example, and “ symbol is used for another ones. It can cause blank screen error also

    A hook surrounds data to be acted upon.

    If an override, it replaces.

    If pre it prepends (above the opening hook tag)

    If post it appends (after the closing hook tag)

    The hook terminates withing the UL tag to you can add LI tags to your heart's content. Other addons can also add LI tags.

    eComLabs - I see that now and it makes sense. I'm not sure how the different " got in there though... damn editor i suppose.

    tbirnseth - thanks for the explanation, it's what we thought would happen. We wanted to do a replacement so we could move the

  • So in the end, this is what fixed it:

    Do the POST.tpl as tbirnseth suggested but with this code:

  • Link Name Here
  • it is at the bottom of the list and we are ok with that. The only thing we may want to change is have it show only to logged in registered users but for now, it's perfect.

    Thanks for everyone's contributions. Curly quotes are the Devil's hack lol.

    Well, you could always just add your own hook in the middle of the list if you wanted such as:

    {hook name="profiles:custom_my_account_hook"}{/hook}

    Then have your own .../hooks/profiles/custom_my_account_hook.post.tpl file.

    The downside is that you would have to re-add that hook tag at every upgrade that modified the file.

    The upside is that you could test for various user groups and do whatever you want within there and get the positioning where you want it.

    Thanks Tbirnseth.

    it's not critical. It was just for a Sales Tax ID upload. After looking at it, it's ok that it's there even for customers not logged in.

    I'm on to other projects now like trying to add checkboxes to the checkout page lol.

    thank you for your assistance, you got me on the right path.