Support Portal Templates

Last modified:


If this article we will explain what each template uses for. 

To create templates you can use context and template tags and filters.

Context

Every page has access to Context. It's a data that you can use to render your template. Below is default context available in every template. Also you will find additional context for some templates in templates description.

  • portal
    • page - current page opened by user (home, category, list, item, new, login, user, public_user, search, error, leaderboard, widget)
    • view - current view for selected page (portal, knowledgebase, community, helpdesk, widget)
    • section - current section for selected view. See values on specific pages if available.
    • user - current user.
    • language_code - interface language code.
    • current_relative_url - relative URL for opened page.
    • current_absolute_ur- absolute URL for opened page.
    • page_no - page number selected in paginator if exists.
    • name - portal name.
    • knowledgebase_forums - knowledge base forums available in portal.
    • comunity_forums - community forums available in portal.
    • helpdesk_forums - helpdesk forums available in portal.
    • knowledgebase_enable - True if knowledge base is enabled in portal.
    • community_enabled - True if community is enabled in portal.
    • helpdesk_enabled - True if helpdesk is enabled in portal.
    • chat_enabled - True if chat is enabled in portal.
    • params - theme specific params as logos, texts, configurations, etc. Will be described later.
  • meta
    • page_title - title for the page
    • page_description - description for the page
    • search_term - search terms if exists

UserEcho support portals consist of pages. Each page generates using some templates. We can split all templates to three groups: structure, pages content, additional custom template.

    Structure

    Structure templates define structure of your portal pages and used on virtually all pages. 

    Portal Layout

    The common layout of your Support Portal Page. It defines main structure like header, footer, content for all pages. it has {{ CONTENT }} variable that contains information for specific opened page generated from specific content template.

    Additional context: 

    • CONTENT - data rendered in a page template to be added to portal layout.

    HEAD Section

    Uses to add information to <HEAD> section of your page. it usually includes meta data, title, third-party loaded fonts, etc.

    SCRIPT Section

    Uses to add any code right before </BODY>. Usually it uses to add some JavaScript to your pages. Please do not forget to wrap your code to <script>...</script> tag if you add JavaScript. 

    By default JQuery is available in your portal, so you can use JQuery syntax. Also if you want to make sure your code will run after page is loaded and all UserEcho variables are initialized you can use:

    <script>
        initqueue.push(function(){
            ... your code is here ...
        })
    </script>

    Pages Content

    Page Content templates are used to render content for specific page visited by users. When page content template rendered it's available in Portal Layout templates as {{ CONTENT }}.

    Portal Home Page

    Main page of your portal. 

    URL: /

    Login Page

    The page for sign in, Sign Up, Password reset, etc

    Additional context: 

    • portal.section - specific page opened by user. May have following values:
      • login (/user/login)
      • login_openid (/user/login/openid)
      • password_reset (/user/password/reset)
      • password_reset_done (/user/password/reset/done)
      • signup (/user/signup)

    Error Page

    Template to generate error message to users.

    Additional context: 

    • error_code - code of error happened. May have values: 
      • access_denied - thew user has no access to the page.
      • page_not_found - the page is not found.


    User Page

    The page for user's settings (own profile)

    Additional context: 

    • portal.section - specific page opened by user. May have following values:
      • settings(/user/settings)
      • notifications (/user/notifications)
      • password_change(/user/password_change)
      • tickets (/user/tickets)
      • topics (/user/topics)
      • voted_topics (/user/voted_topics)
      • updates (/user/updates)

    Search Results Page

    The page to display search results. 

    Additional context: 

    • search
      • results
        • forum_type - type of forum (knowledgebase, community, helpdesk).
        • item_list - list of results for forum type.
        • item_count - count of results in the list.
        • active - True if the type is active (the page has 3 types of results and only one active at the time).
        • url - URL to activate the type.
      • item_count - total item count for all forum types.
      • forum_type__item_count - count of types of forums.
      • forum_type__nonzero_item_count - count of types of forums with some results available.
    • helpdesk_forum - helpdesk forum for the search (helps to add button to submit new ticket).
    • community_forum - community forum for the search (helps to add button to submit new topic).

    URL: /search

    Search Results Popup

    This template generates search results in popup when user starts to input information. It works as suggestion box.

    Additional context: has all the same context as Search Results Page plus: 

    • search_mode - mode of the search.
      • search - when this is popup for search field.
      • suggestion - when this is popup to suggest user similar topics in new topic or ticket form.

    Knowledge Base Home Page

    Template to render knowledge base home page. 

    URL: /knowledge-bases/[id]-[slug] (/knowledge-bases/10-knowledge-base)

    Additional context:

    • forum - selected knowledge base forum.

    Knowledge Base Category Page

    Template to render knowledge base page with category selected. Usually opens if user click on some category in Knowledge Base Home page. Opens if category has subcategories. Otherwise redirects to Knowledge Base Article List Page.

    URL: /knowledge-bases/[id]-[slug]/categories/[id]-[slug] (/knowledge-bases/10-knowledge-base/categories/984-getting-started)

    Additional context: 

    • forum - selected knowledge base forum.
    • category - selected knowledge base category.

    Knowledge Base Article List Page

    Template to render knowledge base article list page. Displays list of articles with filters. 

    URL: /knowledge-bases/[id]-[slug]/categories/[id]-[slug]/articles (/knowledge-bases/10-knowledge-base/categories/984-getting-started/articles)

    Additional context: 

    • forum - selected knowledge base forum.
    • category - selected knowledge base category.
    • forum_or_category - selected knowledge base category (if selected) or forum.

    Knowledge Base Article Page

    Template to render specific article. 

    URL: /knowledge-bases/[id]/articles/[id]-[slug] (/knowledge-bases/10/articles/555-example-article)

    Additional context: 

    • article - selected article.


    Community Home Page

    Template to render community home page.

    URL: /communities/[id]-[slug] (/communities/1-general)

    Additional context: 

    • forum - selected community forum.

    Community Category Page

    Template to render community page with category selected. Usually opens if user click on some category in Community Home page. Opens if category has subcategories. Otherwise redirects to Community Topic List Page.

    URL: /communities/[id]-[slug]/categories/[id]-[slug] (/communities/1-general/categories/33-general-questions)

    Additional context:

    • forum - selected community forum.
    • category - selected community category.

    Community Topic List Page

    Template to render community topic list page. Displays list of topics with filters.

    URL: /communities/[id]-[slug]/categories/[id]-[slug]/topics (/communities/1-general/categories/33-general-questions/topics)

    Additional context:

    • forum - selected community forum.
    • category - selected community category.
    • forum_or_category - selected community category (if selected) or forum.

    Community Topic Page

    Template to render specific article.

    URL: /communities/[id]/topics/[id]-[slug] (/communities/1/topics/444-example-topic)

    Additional context:

    • topic - selected topic.

    Community Topic Form Page

    Template to generate new topic page.

    URL: /communities/[id]-[slug]/topics/new (/communities/1-general/topics/new)

    Additional context:

    • forum - selected community forum.
    • form_mode - form mode to display: new or edit.

    Helpdesk Ticket Page

    Template to render specific ticket.

    URL: /helpdesks/[id]/tickets/[id]-[slug] (/helpdesks/1/tickets/444-example-ticket)

    Additional context:

    • ticket- selected ticket.

    Helpdesk Ticket Form Page

    Template to generate new ticket page.

    URL: /helpdesks/[id]/tickets/new (/helpdesks/3/tickets/new)

    Additional context:

    • forum - selected helpdesk forum.
    • form_mode - form mode to display: new or edit.

    Leaderboard Page

    Template to render leaderboard page for communities.

    URL: /leaderboard

    Public User Page

    The page for user's public profiles if they are allowed in your portal.

    Additional context:

    • portal.section - specific page opened by user. May have following values:
      • profile(/users/[id]-{slug])
      • topics (/users/[id]-{slug]/topics)

    Widget

    Template to render widget page. Shows if you use our widget for your website.

    Additional context:

    • knowledgebase_forum - knowledge base forum for widget if selected.
    • community_forum - community forum for widget if selected.
    • helpdesk_forum - helpdesk forum for widget if selected.
    • knowledgebase_forum - knowledge base forum for widget if selected.
    • portal.widget_mode_is_embedded - True if widget embedded into the page (embed mode).
    • portal.widget_home_link - link to return back to home page of widget.

    This article was helpful for 4 people. Is this article helpful for you?