Recent searches


No recent searches

Sandy Midili's Avatar

Sandy Midili

Joined Jan 11, 2024

·

Last activity Feb 28, 2024

Following

0

Followers

0

Total activity

10

Votes

6

Subscriptions

2

ACTIVITY OVERVIEW

Latest activity by Sandy Midili

Sandy Midili commented,

Community comment Discussion - Tips and best practices from the community

Ifra Saqlain Saqlain What I really want to do is just modify the "On this page" box, which I think is a table of Contents.  It currently only shows Header 2.  I would want to include H3, and H4 with indentations.  

 

Here is my Articles guide.hbs template file:   

{{!----------------------------
   1st Hero element - search bar
   ---------------------------}}

  {{!--------------------
     Hero element content
     --------------------}}
 

    {{!-----------------------
       Hero element search bar
       -----------------------}}
   

 

  {{#isnt settings.hero_image_style 'standard'}}
    {{#isnt settings.hero_image_style 'parallax'}}
      {{!-------------------------------
         Hero background image (overlay)
         -------------------------------}}
     


    {{/isnt}}
  {{/isnt}}

  {{!---------------------
     Hero background color
     ---------------------}}
 

  {{#is settings.hero_image_style 'parallax'}}
    {{!--------------------------------
       Hero background image (parallax)
       --------------------------------}}
   


     

       

     

   

  {{/is}}

{{! /.hero }}

{{!-----------------------------
   2nd Hero element - categories
   ---------------------------}}

  {{!--------------------
     Hero element content
     --------------------}}
 


    {{!--------------
       Category pills
       --------------}}
   
 

  
  {{!---------------------
     Hero background color
     ---------------------}}
 

  {{#is settings.hero_image_style 'parallax'}}
    {{!--------------------------------
       Hero background image (parallax)
       --------------------------------}}
   


     

       

     

   

  {{/is}}

{{! /.hero }}

  {{!------------------
     Section name banner
     -----------------}}

   


       

         


            {{section.name}}    
         


       

   


 

   

http://schema.org/Article">

   {{!----------------------------
  Breadcrumbs
   ---------------------------}}


      
      {{!--------------
         Article header
         --------------}}
     

       


          {{article.title}}
          {{#if article.internal}}
            http://www.w3.org/2000/svg" focusable="false" viewBox="0 0 16 16">
              {{t 'internal'}}
             

        {{!----------------
           Article metadata
           ----------------}}
       

     

      {{!-------------------------------
         Article content and attachments
         -------------------------------}}
     

        {{~#isnt settings.table_of_contents_style 'none'}}
          {{~#isnt settings.table_of_contents_style 'sidebar-left'}}
            {{~#isnt settings.table_of_contents_style 'sidebar-right'}}
              {{!-----------------
                 Table of Contents
                 -----------------}}
             


            {{/isnt~}}
          {{/isnt~}}
        {{/isnt~}}

        {{! Article content and attachments }}
        {{article.body}}
        
        {{#if attachments}}
         


                {{#each attachments}}
                 

  •                 http://www.w3.org/2000/svg" viewBox="0 0 16 16" aria-hidden="true">
                     

  •             {{/each}}
             

        {{/if}}

        {{#is settings.article_metadata 'date-end'}}
          {{! Article metadata }}
         


            {{#is article.created_at article.edited_at}}
              {{date article.created_at timeago=true}}
            {{else}}
              {{t 'updated'}}
              {{date article.edited_at timeago=true}}
            {{/is}}
         


        {{/is}}

     

      {{~#if settings.show_article_sharing}}
        {{!---------------
           Article sharing
           ---------------}}
        {{#if settings.share_title}}
         


           
              {{#if settings.use_translations}}
                {{dc settings.share_title}}
              {{else}}
                {{settings.share_title}}
              {{/if}}
           
{{share}}
         

        {{else}}
         

            {{share}}
         

        {{/if}}
      {{/if}}

      {{~#isnt settings.article_navigation_style 'none'}}
        {{!------------------
           Article navigation
           ------------------}}
                  class="my-6 next-prev-article border-top border-bottom"
          data-element="article-navigation"
          data-template="article-navigation"
          data-next-title="{{#if settings.use_translations}}{{dc settings.next_article_title}}{{else}}{{settings.next_article_title}}{{/if}}"
          data-previous-title="{{#if settings.use_translations}}{{dc settings.previous_article_title}}{{else}}{{settings.previous_article_title}}{{/if}}">
       


      {{/isnt~}}

      {{#if settings.show_article_voting}}
        {{!--------------
           Article voting
           --------------}}
        {{#with article}}
         


           


              {{t 'was_this_article_helpful'}}
           


           

              {{vote 'up' class='button button-outline-primary' selected_class='is-active' role='radio'}}
              {{vote 'down' class='button button-outline-primary' selected_class='is-active' role='radio'}}
           

            {{vote 'label' class='block text-gray-600 font-size-sm mb-4'}}
           


              {{../request_callout}}
           


         

        {{/with}}
      {{/if}}

      {{!---------------------------
         Recent and related articles
         ---------------------------}}
     


        {{#if settings.show_related_articles}}
          {{related_articles}}
        {{/if}}
        {{#if settings.show_recently_viewed_articles}}
          {{recent_articles}}
        {{/if}}
     

      {{#if settings.show_article_comments}}
        {{!----------------
           Article comments
           ----------------}}
       

http://schema.org/UserComments">
         

           


              {{t 'comments'}}
           


           

             


                {{t 'comments_count' count=article.comment_count}}
             


              {{#if comments}}

                {{! Sorters }}
               


              {{/if}}
           

         

          {{#if comments}}
            {{!-------------
               Comments list
               -------------}}
           


                  {{#each comments}}
                   
  •                   {{! Comment metadata }}
                     


                       

                          {{#if author.agent}}
                            http://www.w3.org/2000/svg" viewBox="0 0 12 12" aria-hidden="true">
                             
                           
                          {{/if}}
                          Comment author
                       

                       

                          {{#link 'user_profile' class="link-implied" id=author.id title=author.name}}
                            {{author.name}}
                          {{/link}}
                          {{#each author.badges}}
                            {{#is category_slug "titles"}}
                             
                                {{#if icon_url}}
                                  {{description}}
                                {{/if}}
                                {{name}}
                             

                            {{/is}}
                          {{/each}}
                          {{#each author.badges}}
                            {{#is category_slug "achievements"}}
                              {{#if icon_url}}
                                {{name}}
                              {{/if}}
                            {{/is}}
                          {{/each}}
                         

                              {{#if editor}}
                               

    •                             {{t 'edited'}} {{date edited_at timeago=true}}
                               

    •                         {{else}}
                               

    •                             {{date created_at timeago=true}}
                               

    •                         {{/if}}
                           

                       

                       

                          {{#actions}}
                            http://www.w3.org/2000/svg" viewBox="0 0 16 16" aria-hidden="true">
                             

                     

                      {{#with ticket}}
                       
                          {{t 'request'}}{{id}}
                       

                      {{/with}}
                      {{#if pending}}
                       
                          {{t 'pending_approval'}}
                       

                      {{/if}}

                      {{! Comment content }}
                     


                        {{body}}
                     

                      {{! Comment voting }}
                     


                        {{#vote 'up' class='button button-outline-primary' selected_class='is-active' role='radio'}}
                          http://www.w3.org/2000/svg" focusable="false" viewBox="0 0 16 16">
                           
                         
                        {{/vote}}
                        {{#vote 'down' class='button button-outline-primary' selected_class='is-active' role='radio'}}
                          http://www.w3.org/2000/svg" focusable="false" viewBox="0 0 16 16">
                           
                         
                        {{/vote}}
                     

                      {{vote 'sum' class='font-size-sm text-gray-600 ml-1'}}

                   


  •               {{/each}}
               

          {{/if}}

          {{pagination}}

          {{!------------
             Comment form
             ------------}}
          {{#form 'comment' class='form text-right'}}
           


             

                {{user_avatar class='avatar-img'}}
             

             

                {{wysiwyg 'body'}}
             

           

            {{input type='submit'}}
          {{/form}}

         


            {{comment_callout}}
         

       


      {{/if}}

   

    {{!-----------------
       Left-hand sidebar
       -----------------}}
   


        {{/is~}}
      {{/isnt~}}

      {{~#is settings.table_of_contents_style 'sidebar-left'}}
     
  {{!-----------------
         Table of Contents
         -----------------}}
       


      {{/is~}}

   

    {{!------------------
       Right-hand sidebar
       ------------------}}
   


    
  {{! /.row }}
{{! /#page-container }}

{{~#isnt settings.cta_style 'none'}}
  {{~#isnt settings.cta_style 'sidebar'}}
    {{~#isnt settings.cta_location 'home'}}
      {{!--------------
         Call-to-action
         --------------}}
     


    {{/isnt~}}
  {{/isnt~}}
{{/isnt~}}

{{!---------------
   Micro-templates
   ---------------}}
{{~#is settings.article_navigation_style 'standard'}}
  {{!------------------
     Article navigation
     ------------------}}
 
{{/is~}}

{{~#isnt settings.table_of_contents_style 'none'}}
  {{!-----------------
     Table of Contents
     -----------------}}
  {{~#is settings.table_of_contents_style 'simple'}}
    {{! Simple }}
   
  {{/is~}}
  {{~#is settings.table_of_contents_style 'boxed'}}
    {{! Boxed }}
   
  {{/is~}}
  {{~#is settings.table_of_contents_style 'full-width'}}
    {{! Full-width }}
   
  {{/is~}}

  {{~#isnt settings.table_of_contents_style 'simple'}}
    {{~#isnt settings.table_of_contents_style 'boxed'}}
      {{~#isnt settings.table_of_contents_style 'full-width'}}
        {{! Sidebar }}
       
      {{/isnt}}
    {{/isnt}}
  {{/isnt}}

  {{~#isnt settings.table_of_contents_style 'sidebar-left'}}
    {{~#isnt settings.table_of_contents_style 'sidebar-right'}}
      {{! Nested items list }}
     
    {{/isnt}}
  {{/isnt}}
{{/isnt}}
                  

View comment · Posted Jan 18, 2024 · Sandy Midili

0

Followers

0

Votes

0

Comments


Sandy Midili commented,

Community comment Discussion - Tips and best practices from the community

I need some help trying to understand what previous consultants did and modify the Table of Contents that is labeled "On This Page," which is in a box on the right of my articles.  Currently, our code only adds headers into the On This Page box if they are header 2.  I want to add header 3 and header 4.  It looks like they may have used a modified Copenhagen Theme.  The Theme version is 2.0.0 and Templating API v2.  

I have searched the help files and community to no avail.  I am hoping you can help.  I am new at ZenDesk and coding. The consulting company is no longer around for me to ask questions.  So I apologize for my ignorance.  Any help would be greatly appreciated.  Thank you.

See the screenshot of a sample of an article below:

 

Here is the document_head.hbs file that looks similar to the first post, but line 7  has a 3.5.1 in it instead of 3.6.0

Here is the section of the article_page.hbs file that references the table of contents.  I did try to add a simple addition of .content h3 into the code, but that does not work.  

Here is my script.js file, in which I can't find any mention of the table of contents:  

(function() {
  "use strict";

  ready(function() {

    // Restore focus after page reload
    var returnFocusTo = sessionStorage.getItem('returnFocusTo');
    if (returnFocusTo) {
      sessionStorage.removeItem('returnFocusTo');
      var returnFocusToEl = document.querySelector(returnFocusTo);
      returnFocusToEl && returnFocusToEl.focus && returnFocusToEl.focus();
    }

    // Open social sharing links in a new window
    each('.share a', function(a) {
      a.addEventListener('click', function(e) {
        e.preventDefault();
        window.open(this.href, '', 'height = 500, width = 500');
      });
    });

    // Render inline micro-templates
    each('[data-element="template"]', function(el) {
      if (el.hasAttribute('data-template')) {
        Util.renderTemplate(el, el.getAttribute('data-template'));
      }
    });

    // Add focus classname to search field
    each('.form-field [type="search"]', function(el) {
      el.addEventListener('focus', function() { this.parentNode.classList.add(Util.classNames.FOCUS); });
      el.addEventListener('focusout', function() { this.parentNode.classList.remove(Util.classNames.FOCUS); });
    });

    // Replace images with inline SVG
    Array.prototype.forEach.call(document.querySelectorAll('[data-inline-svg]'), Util.replaceWithSVG);

    // Smooth scroll
    function maybeScroll() {
      var smoothScroll = Util.getURLParameter('smooth-scroll', window.location);
      if (smoothScroll === 'true' && window.location.hash) {
        var offset = Util.getURLParameter('offset', window.location);
        var target = document.getElementById(window.location.hash.substring(1).split("?")[0]);
        Util.scrollIntoView(target, offset);
      }
    }

    window.addEventListener('hashchange', maybeScroll, false);
    maybeScroll();

    /**
     * Collapsible nav plugin.
     * @param el
     * @constructor
     */
    function CollapsibleNav(el) {
      this.el = el;
      el.addEventListener('click', this.onClick.bind(this));
    }

    CollapsibleNav.prototype = {

      onClick: function(e) {
        var maxHeight = window.getComputedStyle(this.el).maxHeight;
        if (maxHeight === 'none') {
          return;
        }

        var isExpanded = this.el.getAttribute('aria-expanded') === 'true';
        var navLink = e.target;

        if (isExpanded) {

          // Close the nav if the clicked link is selected
          if (navLink.getAttribute('aria-selected') === 'true') {
            this.el.setAttribute('aria-expanded', 'false');
            this.el.classList.remove('is-expanded');
            navLink.setAttribute('aria-selected', 'false');
            e.preventDefault();
          }
        } else {

          // Open the nav if it's closed
          this.el.setAttribute('aria-expanded', 'true');
          this.el.classList.add('is-expanded');
          navLink.setAttribute('aria-selected', 'true');
          e.preventDefault();
        }
      }
    };

    each('.collapsible-nav', function(nav) {
      new CollapsibleNav(nav);
    });

    window.CollapsibleNav = CollapsibleNav;

    
(function() {
  "use strict";

 
  });
})();

  
  });
})();

View comment · Posted Jan 18, 2024 · Sandy Midili

0

Followers

0

Votes

0

Comments