Recent searches


No recent searches

Tip: Add Current Article Title In The Breadcrumbs On Article Template



image avatar

Ifra Saqlain

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

Posted Jul 31, 2021

Prerequisite:

JavaScript

Article Page

Time To Read: Max 1min

Time To Embed: Max 1min

 

Hi to all,

I am going to do a simple thing but new to new :D I meant new to new people who are in hurry like doing any customization project and they need help for sudden if they face this kind of requirement so without wasting the time let's get started.

I. Copy the below code and paste into your script.js file under the DOM function.

    function articleInBreadcrumb(){
var parent = document.querySelector('.breadcrumbs').innerHTML += articleTitle;
}
articleInBreadcrumb();

 

Screenshot for the same:

 

 

II. Copy the below article title code and paste into your article_page.hbs file at the top.

<script>
var articleTitle = ' > {{article.title}}';
</script>

 

Screenshot for the same:

 

III. Output is - see the breadcrumbs, article title has added.

 

 

Thanks Guys:)

 


2

0

0 comments

Please sign in to leave a comment.

Didn't find what you're looking for?

New post