Comment formater le texte de l’article via le code source ?



image avatar

Ricardo Pinto

Zendesk Digital Resources Team

Modification le 22 avr. 2025


7

0

22 commentaire

Hello Jennifer,
 
It looks like there are two different types of double-quotes used in your code, which is why it's not working properly. 
One is the straight, plain text quotes, and the other is curvy "Smart quotes" which causes the coding to break.
 
Can you please try re-formatting your code and use only the plain text quotes (" ") instead? 

<p class="hero-text">Call <a class="hero-link" href="tel:123-456-7890">123-456-7890</a> for Support</p>

0


Hey Sierra/Everyone, 
Hoping someone can help me. 
I tried adding the link on the home_page.hbs file like so: 

 <p class="hero-text">Call <a class="hero-link" href=“tel:123-456-7890”>123-456-7890</a> for Support</p>
Clicking on the link takes me to zendesk 404 error page. 

Did you take any additional steps to get it to work? I've also gone to settings --> Guide Settings --> Security and checked the box for Display Unsafe Content which was suggested in another help article. 

0


Hello, this anchor formula is not working in the article. It creates a link, but doesnt dial out.
 
It only works in the edit code. I tested it in the edit code of the home page and it works. 

0


Hi Sierra Collins,

Do the following:-

i). Open source code of an article.

ii). Write your phone number with anchor tag like this.

  <a href="tel:123-456-7890">123-456-7890</a>




iii). Click OK button.

iv). Save your article which you have been edit for this.

v). Now, your number would be dial by a click.

 

 

Thanks

Team

0


Hello, how do I edit source code for a phone number within an article? So the phone number can be dialed by clicking the linked number. 

0


Hey ,

Just do the following:

i). Copy paste the code to your script.js file. You will need to add your URLs as mentioned below.

jQuery($ => {
  $('.article-list-item.article-promoted > a').attr('href', (i, h) => h.replace('ORININAL HREF VALUE', 'ANOTHER WEBSITE LINK'));
});


Screenshot for the same:




Ex.

 

ii). jquery CDN to document_head.hbs file.

 

 

Thanks

 

 

0


I have a question. How can I make it so when someone clicks on an article in a section, that it goes to another website? 

 

 

 

0


Hi Fernando,
 
It's likely that you're using HTML tags or attributes that are considered "unsafe". There's information this, and how to allow unsafe HTML, here: Allowing unsafe HTML in help center articles

0


Question guys, I am trying to add border to images and add some text that will be hidden to the user but searchable to the engine, using the code snippet and inline styling, and all works just fine in the editor but not in the preview, or when I am publishing it, I am doing something wrong? thank you in advance. 

0


Hi Edisa,

We do not have a specific article that shows a step by step way of doing this however if you go into an article, the article source code can be pulled by clicking on this button from the toolbar.

This opens up the editor where you can enter HTML codes to embed a video you desire. While custom coding is outside our scope of support, I am sharing this piece of code with you which I have found online that works for me:

 

0


Vous connecter pour laisser un commentaire.