Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamics Portal - Header, User Dropdown

Posted on by Microsoft Employee

Hello,

explenation of my problem:

Beeing logged in as admin and clicking on the user in the right upper corner of the portal there appears a dropdown with "profile", "forum subscription" and "sign out"

Beeing logged in with a testuser I can only see "sign out". By editing the URL I can navigate to "profile" and "forum subscriptions". So the user has accesse rules for this pages. 
They just woun´t show up in the header dropdown.

Does anyone have an idea how to fix this?

Thanks!

Roman P.

3007.Header.PNG

*This post is locked for comments

  • Suggested answer
    Nicholas Hayduk Profile Picture
    Nicholas Hayduk 2,863 on at
    RE: Dynamics Portal - Header, User Dropdown

    The header liquid code looks fine.

    As a test, assign the user the Administrator web role and see if the items appear in the menu.  If they do, you know for sure it's a permissions thing.

    You want to ensure that the user has a web role with the "Restrict Read" web page access control rule associated with those pages.  Grant change gives them the permission to edit the content of the page (like an administrator).  Restrict read lets them view the page (including using the form - use of the form isn't controlled by web page access control rules).  Grant change should only ever be given to administrators/content authors.

    Nick

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics Portal - Header, User Dropdown

    Hey Nicholas,

    I don´t know whether this is custom or not. I´m quite new to portal and the project was almost finished when I received the remaining tasks to be solved.

    So this is the code:

    {% assign homeurl = website.adx_partialurl %}

    <div class="navbar navbar-inverse navbar-static-top" role="navigation">

     <div class="container">

       <div class="navbar-header">

         <div class="visible-xs-block visible-sm-block visible-md-block visible-lg-block navbar-brand">

           {% editable snippets 'Navbar Left' type: 'html' %}

         </div>

         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" onclick="setHeight();">

           <span class="sr-only">Toggle navigation</span>

           <span class="icon-bar"></span>

           <span class="icon-bar"></span>

           <span class="icon-bar"></span>

         </button>

       </div>

       <div id="navbar" class="navbar-collapse collapse">

         {% assign primary_nav = weblinks["Primary Navigation"] %}

         {% if primary_nav %}

           <div class="navbar-right menu-bar {% if primary_nav.editable %}xrm-entity xrm-editable-adx_weblinkset{% endif %}" data-weblinks-maxdepth="2">

             <ul class="nav navbar-nav weblinks">

               {% for link in primary_nav.weblinks %}

                 {% unless forloop.first %}

                   <li class="divider-vertical"></li>

                 {% endunless %}

                 {% if link.display_page_child_links %}

                   {% if link.url != null %}

                     {% assign sublinks = sitemap[link.url].children %}

                   {% endif %}

                 {% else %}

                   {% assign sublinks = link.weblinks %}

                 {% endif %}

                 <li class="weblink {% if sublinks.size > 0 %} dropdown{% endif %}">

                   <a {% if sublinks.size > 0 -%}

                       href="#" class="dropdown-toggle" data-toggle="dropdown"

                       {%- else -%}

                       href="{{ link.url | escape }}"

                       {%- endif -%}

                       {%- if link.Open_In_New_Window %} target="_blank" {% endif -%}

                       {%- if link.nofollow %} rel="nofollow"{% endif -%}

                       {%- if link.tooltip %} title="{{ link.tooltip | escape }}"{% endif %}>

                       {%- if link.image -%}

                         {%- if link.image.url startswith '.' -%}

                           <span class="{{ link.image.url | split:'.' | join }}" aria-hidden="true"></span>

                         {%- else -%}

                           <img src="{{ link.image.url | escape }}"

                                alt="{{ link.image.alternate_text | default:link.tooltip | escape }}"

                                {% if link.image.width %}width="{{ link.image.width | escape }}" {% endif %}

                                {% if link.image.height %}height="{{ link.image.height | escape }}" {% endif %} />

                         {%- endif -%}

                       {%- endif -%}

                       {%- unless link.display_image_only -%}

                         {{ link.name | escape }}

                       {%- endunless -%}

                       {%- if sublinks.size > 0 -%}

                         <span class="caret"></span>

                       {%- endif -%}

                   </a>

                   {% if sublinks.size > 0 %}

                     <ul class="dropdown-menu" role="menu">

                       {% if link.url %}

                         <li>

                           <a href="{{ link.url }}"

                              {% if link.Open_In_New_Window %} target="_blank" {% endif %}

                              {% if link.nofollow %}rel="nofollow" {% endif %}

                              {% if link.tooltip %}title="{{ link.tooltip }}" {% endif %}>{{ link.name }}</a>

                         </li>

                         <li class="divider"></li>

                       {% endif %}

                       {% for sublink in sublinks %}

                         <li>

                           <a href="{{ sublink.url }}"

                              {% if sublink.Open_In_New_Window %} target="_blank" {% endif %}

                              {% if sublink.nofollow %}rel="nofollow" {% endif %}

                              {% if sublink.tooltip %}title="{{ sublink.tooltip }}" {% endif %}>

                              {{ sublink.name | default:sublink.title }}

                           </a>

                         </li>

                       {% endfor %}

                     </ul>

                   {% endif %}

                 </li>

               {% endfor %}

               {% assign search_enabled = settings['Search/Enabled'] | boolean | default:true %}

               {% if search_enabled %}

               <li class="divider-vertical"></li>

               <li class="dropdown">

                 <a class="navbar-icon" href="#" data-toggle="dropdown"

                   role="button" aria-haspopup="true" aria-expanded="false"

                   aria-label="{{ snippets["Header/Search/ToolTip"] | default:resx["Search_DefaultText"] | escape }}" >

                   <span class="glyphicon glyphicon-search"></a>

                 </a>

                 <ul class="dropdown-menu dropdown-search">

                   <li>

                     {% include 'Search' %}

                   </li>

                 </ul>

               </li>

               {% endif %}

               <li class="divider-vertical"></li>

               {% if website.languages.size > 1 %}

                 <li class="dropdown">

                   <a class="dropdown-toggle" href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" title="{{ website.selected_language.name | escape }}">

                     <span class="drop_language">{{ website.selected_language.name | escape }}</span>

                     <span class="caret"></span>

                   </a>

                   {% include 'Languages Dropdown' %}

                 </li>

               <li class="divider-vertical"></li>

               {% endif %}

               {% if user %}

                 <li class="dropdown">

                   <a href="#" class="dropdown-toggle" title="{{ user.fullname | escape }}" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">

                       <span class="fa fa-user" aria-hidden="true"></span>

                       <span class="caret"></span>

                   </a>

                   <ul class="dropdown-menu" role="menu">

                     {% assign show_profile_nav = settings["Header/ShowAllProfileNavigationLinks"] | boolean | default:true %}

                     {% if show_profile_nav %}

                       {% assign profile_nav = weblinks["Profile Navigation"] %}

                       {% if profile_nav %}

                         {% for link in profile_nav.weblinks %}

                           <li>

                             <a href="{{ link.url | escape }}" title="{{ link.name | escape }}">{{ link.name | escape }}</a>

                           </li>

                         {% endfor %}

                       {% endif %}

                     {% else %}

                       <li><a href="{{ sitemarkers['Profile'].url | escape }}">{{ snippets["Profile Link Text"] | default:"Profile" }}</a></li>

                     {% endif %}

                     <li class="divider" role="separator"></li>

                     <li>

                       <a href="{% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_out_url_substitution }}" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">

                         {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}

                       </a>

                     </li>

                   </ul>

                 </li>

               {% else %}

                 <li>

                   <a href="{% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_in_url_substitution }}">

                         {{ snippets["links/login"] | default:resx["Sign_In"] }}

                   </a>

                 </li>

               {% endif %}

             </ul>

             {% editable primary_nav %}

           </div>

         {% endif %}

       </div>

     </div>

    </div>

    {% substitution %}

     {% assign current_page = page.id %}

     {% assign sr_page = sitemarkers["Search"].id %}

     {% assign forum_page = sitemarkers["Forums"].id %}

     {% if current_page == sr_page or current_page == forum_page %}

       {% assign section_class = "section-landing-search" %}

       {% if current_page == forum_page %}

         {% assign section_class = "section-landing-forums" %}

       {% endif %}

       <section class="page_section {{ section_class | h }} color-inverse">

         <div class="container">

           <div class="row ">

             <div class="col-md-12 text-center">

               {% if current_page == sr_page %}

                 <h1 class="section-landing-heading">{% editable snippets 'Search/Title' default: resx["Discover_Contoso"] %}</h1>

                 {% include 'Search' %}

               {% endif %}

             </div>

           </div>

         </div>

       </section>

     {% endif %}

    {% endsubstitution %}

    <script type="text/javascript">

             function setHeight(){

              var windowHeight = window.innerHeight - 140;

              var navbar = document.getElementById("navbar");

              if (navbar) {

               navbar.style.maxHeight = windowHeight + "px";

      }

             }

             window.addEventListener('resize', function (event) {

              setHeight();

             });

    </script>

    Containing the web roles:

    The test user has the web role "Active Contract"

    I addes this Web role to the web page access controle role "Grant Change Profile"

    And this web page access controle role is attached to the web page "profile"

    Is this the correct proceeding?

    Greetings

    Roman

  • Suggested answer
    Summer Garg Profile Picture
    Summer Garg 585 on at
    RE: Dynamics Portal - Header, User Dropdown

    Hi Roman,

    Have you provided any web role to your test user ? if not then provide role and then check else check your Liquid Code which is written in Web Template of Header.

    For more information of UserDropdown, check this article on this :

    crmhub.blogspot.com/.../d365-portal-modify-user-profile-dropdown-naviagtion-rename-signout-profile.html

  • Nicholas Hayduk Profile Picture
    Nicholas Hayduk 2,863 on at
    RE: Dynamics Portal - Header, User Dropdown

    Hi Roman,

    What does the Liquid code look like in your header?  Is there any custom logic in there that would hide those links based on some other condition?  If you don't see anything obvious, post it here so I can take a look.

    Nick

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans