Article Link Opening Attachments

5 Comments

  • Ifra Saqlain
    Community Moderator

    Hey Melody,

    Please go through this article:

    https://support.zendesk.com/hc/en-us/community/posts/360029202454-Hyperlink-text-to-PDF-attachment

    Hope it will resolve your query :)

    Thanks

    Team

    1
  • Melody Quinn

    Hi Ifra, 

    That is what I used to link "Available Room Reports" in the screenshot above, however I do not want the attachments to show at the bottom of the page. If this is the only way, the attachment would have to exist somewhere on the help site as a public article. I was hoping this wasn't the case.  

    0
  • Dan Cooper
    Community Moderator

    Melody Quinn,

    If you are using the Copenhagen theme you can reference Zendesk's Github copenhagen_theme repository (link goes too specific line of code) for the theme code you'd need to change for this.  Otherwise you'll always have the attachments at the bottom of your article even if you link them in the content directly. 

    You'll need to remove the section that shows the attachments for your article page in order to remove those.  You may find other themes implement this differently but the line I linked to should reference a similar placeholder used.

    0
  • Melody Quinn

    Hi Dan Cooper

    Thank you! We started with copenhagen and have edited the code. The version we are using is Templating API v1 (1.5.0). Our template code looks a bit different than our sandbox (API v2 - 2.2.4). I suspect the sandbox uses the most recent version. 

    In our sandbox, I removed the code for the attachments as you instructed, and I could attach the document, copy the link address from the article settings panel, link the attachment to text in the article and the attachment did not show at the bottom of the page. Exactly what I want!

    I copied our article code from our live site (1.5.0) and removed the attachment section we have, but the document still shows at the bottom of the article. I'll drop the code of our unaltered live template (1.5.0) here in case you or anyone else wants to take a crack at it. 

    Thanks again, I appreciate your help!

     

    <div class="container-divider"></div>
    <div class="container">
    <nav class="sub-nav">
    {{breadcrumbs}}
    {{search scoped=settings.scoped_kb_search submit=false}}
    </nav>

    <div class="article-container" id="article-container">
    <section class="article-sidebar">
    {{#if settings.show_articles_in_section}}
    <section class="section-articles collapsible-sidebar">
    <h3 class="collapsible-sidebar-title sidenav-title">{{t 'articles_in_section'}}</h3>
    <ul>
    {{#each section.articles}}
    <li>
    <a href="{{url}}" class="sidenav-item {{#is id ../article.id}}current-article{{/is}}">{{title}}</a>
    </li>
    {{/each}}
    </ul>
    {{#if section.more_articles}}
    <a href="{{section.url}}" class="article-sidebar-item">{{t 'see_more'}}</a>
    {{/if}}
    </section>
    {{/if}}
    </section>

    <article class="article">
    <header class="article-header">
    <h1 title="{{article.title}}" class="article-title">
    {{article.title}}
    {{#if article.internal}}
    <span class="icon-lock" title="{{t 'internal'}}"></span>
    {{/if}}
    </h1>

    <div class="article-author">
    {{#if settings.show_article_author}}
    <div class="avatar article-avatar">
    {{#if article.author.agent}}
    <span class="icon-agent"></span>
    {{/if}}
    <img src="{{article.author.avatar_url}}" alt="" class="user-avatar"/>
    </div>
    {{/if}}
    <div class="article-meta">
    {{#if settings.show_article_author}}
    {{#link 'user_profile' id=article.author.id}}
    {{article.author.name}}
    {{/link}}
    {{/if}}

    <ul class="meta-group">
    {{#is article.created_at article.edited_at}}
    <li class="meta-data">{{date article.created_at timeago=true}}</li>
    {{else}}
    <li class="meta-data">{{date article.edited_at timeago=true}}</li>
    <li class="meta-data">{{t 'updated'}}</li>
    {{/is}}
    </ul>
    </div>
    </div>

    {{#if settings.show_follow_article}}
    {{subscribe}}
    {{/if}}
    </header>

    <section class="article-info">
    <div class="article-content">
    <div class="article-body">{{article.body}}</div>

    <div class="article-attachments">
    <ul class="attachments">
    {{#each attachments}}
    <li class="attachment-item">
    <a href="{{url}}" target="_blank">{{name}}</a>
    <div class="attachment-meta meta-group">
    <span class="attachment-meta-item meta-data">{{size}}</span>
    <a href="{{url}}" target="_blank" class="attachment-meta-item meta-data">Download</a>
    </div>
    </li>
    {{/each}}
    </ul>
    </div>
    </div>
    </section>

    <footer>
    <div class="article-footer">
    {{#if settings.show_article_sharing}}
    <div class="article-share">{{share}}</div>
    {{/if}}
    {{#if settings.show_article_comments}}
    {{#if comments}}
    <a href="#article-comments" class="article-comment-count">
    <span class="icon-comments"></span>
    {{article.comment_count}}
    </a>
    {{/if}}
    {{/if}}
    </div>
    {{#with article}}
    <div class="article-votes">
    <span class="article-votes-question">{{t 'was_this_article_helpful'}}</span>
    <div class="article-votes-controls" role='radiogroup'>
    {{vote 'up' role='radio' class='button article-vote article-vote-up'}}
    {{vote 'down' role='radio' class='button article-vote article-vote-down'}}
    </div>
    <small class="article-votes-count">
    {{vote 'label' class='article-vote-label'}}
    </small>
    </div>
    {{/with}}


    </footer>

    <section class="article-relatives">
    {{#if settings.show_recently_viewed_articles}}
    {{recent_articles}}
    {{/if}}
    {{#if settings.show_related_articles}}
    {{related_articles}}
    {{/if}}
    </section>
    {{#if settings.show_article_comments}}
    <div class="article-comments" id="article-comments">
    <section class="comments">
    <header class="comment-overview">
    <h3 class="comment-heading">
    {{t 'comments'}}
    </h3>
    <p class="comment-callout">{{t 'comments_count' count=article.comment_count}}</p>
    {{#if comments}}
    <div class="dropdown comment-sorter">
    <button class="dropdown-toggle" aria-haspopup="true">
    {{t 'sort_by'}}
    </button>
    <span class="dropdown-menu" role="menu">
    {{#each comment_sorters}}
    <a aria-selected="{{selected}}" href="{{url}}" role="menuitem">{{name}}</a>
    {{/each}}
    </span>
    </div>
    {{/if}}
    </header>

    <ul id="comments" class="comment-list">
    {{#each comments}}
    <li id="{{anchor}}" class="comment">
    <div class="comment-wrapper">
    <div class="comment-info">
    <div class="comment-author">
    <div class="avatar comment-avatar">
    {{#if author.agent}}
    <span class="icon-agent"></span>
    {{/if}}
    <img src="{{author.avatar_url}}" alt="" class="user-avatar"/>
    </div>
    <div class="comment-meta">
    <span title="{{author.name}}">
    {{#link 'user_profile' id=author.id}}
    {{author.name}}
    {{/link}}
    </span>

    <ul class="meta-group">
    {{#if editor}}
    <li class="meta-data">{{date edited_at timeago=true}}</li>
    <li class="meta-data">{{t 'edited'}}</li>
    {{else}}
    <li class="meta-data">{{date created_at timeago=true}}</li>
    {{/if}}
    </ul>
    </div>
    <div class="comment-labels">
    {{#with ticket}}
    <a href="{{url}}" target="_zendesk_lotus" class="status-label escalation-badge">
    {{t 'request'}}{{id}}
    </a>
    {{/with}}
    {{#if pending}}
    <span class="comment-pending status-label status-label-pending">{{t 'pending_approval'}}</span>
    {{/if}}
    </div>
    </div>

    <section class="comment-body">{{body}}</section>
    </div>

    <div class="comment-actions-container">
    <div class="comment-vote vote" role='radiogroup'>
    {{vote 'up' role='radio' class='vote-up' selected_class='vote-voted'}}
    {{vote 'sum' class='vote-sum'}}
    {{vote 'down' role='radio' class='vote-down' selected_class='vote-voted'}}
    </div>
    <div class="comment-actions actions">
    {{actions}}
    </div>
    </div>
    </div>
    </li>
    {{/each}}
    </ul>

    {{pagination}}

    {{#form 'comment' class='comment-form'}}
    <div class="avatar comment-avatar">
    {{user_avatar class='user-avatar'}}
    </div>
    <div class="comment-container">
    {{wysiwyg 'body'}}
    <div class="comment-form-controls">
    {{input type='submit'}}
    </div>
    </div>
    {{/form}}

    <p class="comment-callout">{{comment_callout}}</p>
    </section>
    </div>
    {{/if}}
    </article>
    </div>
    </div>




    0
  • Dan Cooper
    Community Moderator

    Melody Quinn,

    I haven't tested the code out directly, but looking at what you have listed out it looks like if you were to remove this div

     <div class="article-attachments">
    <ul class="attachments">
    {{#each attachments}}
    <li class="attachment-item">
    <a href="{{url}}" target="_blank">{{name}}</a>
    <div class="attachment-meta meta-group">
    <span class="attachment-meta-item meta-data">{{size}}</span>
    <a href="{{url}}" target="_blank" class="attachment-meta-item meta-data">Download</a>
    </div>
    </li>
    {{/each}}
    </ul>
    </div>

    it should entirely remove the attachments logic from the template.

    0

Please sign in to leave a comment.

Powered by Zendesk