Recent searches


No recent searches

How to change the name for promoted articles?

Answered


Posted Jun 17, 2022

Hello,

I believe it is possible to change the name promoted articles on the homepage to Helpdesk Support for example?

 

I can see this on the edit code page on the home page but can someone please advise of the script you have to change it to and on what pages to make this change?

Thank you.

Kind Regards,

Anton

 


1

5

5 comments

image avatar

Ifra Saqlain

Zendesk LuminaryMost Engaged Community Member - 2022Most Engaged Community Member of The Year - 2021Community Moderator

Hi Anton Van der meyden, you can change it on the home_page.hbs but if you want to change the title via JS code then just copy and paste it to your script.js file.

document.querySelector("h2.promoted-article").innerText = "WRITE YOUR TITLE HERE";


h2.promoted-article: Your class name may be different.

 

You can directly change it on home_page.hbs file.

0


Ifra Saqlain

Hi Ifra,

Thank you for your help.

Kind Regards,

Anton

0


Hi Ifra Saqlain - my home page's code looks a little different and the above guidance doesn't work. Any ideas on how to change the word "promoted" based on my code (see below)?

<div class="container">
  <section class="section knowledge-base">
    
     {{#if promoted_articles}}
      <section class="articles">
        <h2>{{t 'promoted_articles'}}</h2>
        <ul class="article-list promoted-articles">
          {{#each promoted_articles}}
            <li class="promoted-articles-item">
                <a href="{{url}}">
                  {{title}}

0


image avatar

Ifra Saqlain

Zendesk LuminaryMost Engaged Community Member - 2022Most Engaged Community Member of The Year - 2021Community Moderator

Hi Breanne Brock , :)

Change the name of your title then do the following:

Current Code:

<div class="container">
  <section class="section knowledge-base">
    
     {{#if promoted_articles}}
      <section class="articles">

      <h2> {{t 'promoted_articles'}} </h2>

        <ul class="article-list promoted-articles">
          {{#each promoted_articles}}
            <li class="promoted-articles-item">
                <a href="{{url}}">
                  {{title}}

 

 

Update Code:

<div class="container">
  <section class="section knowledge-base">
    
     {{#if promoted_articles}}
      <section class="articles">

      <h2> WRITE YOUR TEXT HERE </h2>

        <ul class="article-list promoted-articles">
          {{#each promoted_articles}}
            <li class="promoted-articles-item">
                <a href="{{url}}">
                  {{title}}

 

 

OR

If you want to show the title in multiple languages then you can use Dynamic Placeholder.

https://support.zendesk.com/hc/de/community/posts/4581644213658-Dynamic-Content-in-Guide-Search-Placeholder-

 

 

With the DC Placeholder:

<div class="container">
  <section class="section knowledge-base">
    
     {{#if promoted_articles}}
      <section class="articles">

    <h2> {{dc 'custom_text}} </h2>

        <ul class="article-list promoted-articles">
          {{#each promoted_articles}}
            <li class="promoted-articles-item">
                <a href="{{url}}">
                  {{title}}

 

 

If any confusion feel free to share :)

Thanks

Team

0


Thank you, Ifra Saqlain! I really appreciate it!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post