Templates: current_sorter on User Profile template causes some terrible error

Respondida

3 Comentarios

  • Laura Hippert
    Acciones de comentarios Permalink

    Hi Dru,

    The current_sorter property should be available for use on the User Profile page, and is used in the default Copenhagen theme that is available in the Help Center. The way that it is used is the following:

    {{#if contributions}}

    <header class="profile-section-header">
    <h2 class="profile-section-title">{{t filter_by}}</h2>
    {{#if sorters}}
    <span class="profile-section-description">{{sorter_description}}</span>
    <span class="profile-section-sorter dropdown">
    <span class="dropdown-toggle">
    {{current_sorter.label}}
    </span>
    <span class="dropdown-menu" role="menu">
    {{#each sorters}}
    <a href="{{url}}" aria-selected="{{selected}}" role="menuitem">
    {{name}}
    </a>
    {{/each}}
    </span>
    </span>
    {{/if}}
    </header>


    You can also view more details about this property in our documentation: https://developer.zendesk.com/apps/docs/help-center-templates/user_profile_page

    I hope that helps!

    0
  • Dru Kepple
    Acciones de comentarios Permalink

     

    Maybe I should step back and ask what is the `current_sorter`? It doesn't exist when you go to the user profile page. What do you need to do (as a user, on the page) in order to have a value in `current_sorter`?

    The code snippet you posted (and that I have in my template) is wrapped in `{{#isnt filter_by 'activities'}}`. I don't know how it's supposed to work, but it would seem that the initial view of the user profile page is filtered by activities, so the snippet you posted does not run.

    I would assume that if you clicked on "articles" you should get a different view; same with "posts" and "comments." However, when I click on those links, the page appears to load but always shows the Activity Overview.

    So I don't think the code involving `current_sorter` is ever running, but when I put `{{current_sorter.label}}` outside of that block, I get the "oops" error.

     

    0
  • Laura Hippert
    Acciones de comentarios Permalink

    Hi Dru,

    The current_sorter ojects are specific to the Sort by recent activity feature which you'll find on several pages - including inside the "Posts" on the User profile page:

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk