Recent searches


No recent searches

Including article title in a URL parameter

Answered


Posted May 18, 2018

I'm trying to add to our Guide templates a link element that would use the article title included as a URL parameter. I've tried this:

<p><a href="https://example.com/form/&parameter={{article.title}}">Click here</a></p>

But the Curlybars {{article.title}} doesn't bring in the article title property like I'd expect. I get the same result using this, outside a link:

<p>{{article.title}}</p>

What am I missing about accessing and using page properties? I've read this support article: https://support.zendesk.com/hc/en-us/articles/205753348-Using-the-Help-Center-templating-language-Guide-Professional-and-Enterprise-


0

7

7 comments

image avatar

Leah Hughes

Zendesk Employee

Hi there!

The article object by default is only available on the on the article page. You can find more on that here.

You can still access this data by going through the category and/ section object to get to the article object, depending on the page you're on. Which page is it that you're trying to add this property? 

 

0


Hi Leah,

Grant and I are creating a Google Forms survey, and want to include a link to the survey from help center article pages. When someone clicks the survey link from an article page, we'd like to auto-populate a field in the survey with the referral page URL and/or article title, so that we can correlate the feedback we receive to the help center article that generated it.

We had this working when we were using a different doc tool, but are not sure how to replicate this behavior in the article_page.hbs template.

@Wes - thoughts on how to accomplish this? 

Thx!

Deb

0


image avatar

ModeratorWes

Most Engaged Member of All Time - 2021

@Deb - What template are tying to insert this on.  I did a quick test and what Grant had above worked for me when plugging it into the Article template.

<p><a href="https://example.com/form/&parameter={{article.title}}">Click here</a></p>

 

As you can see above it added the title "Getting Started fro Project Managers".

0


@Wes, we want to add this to the article_page.hbs template only.

Could it be because we're trying to use dynamic content? We want the article title to populate into either an English or Spanish survey, depending upon if the survey participant selects the link from an English or Spanish help center article. Here's what it will look like on the article page:

Here's the code in the article_page.hbs, where we're using dynamic content for both 'Help us to improve our Help Center' and 'Send us your feedback':

Here's the dynamic content survey code {{ dc 'send_us_your_feedback'}} :

<p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform" rel="noopener">Send us your feedback</a></p>

 

And in Spanish:

<p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSeAa2VWYhYTw_-RmahWKDK1-yGHJVOwc3aL5K1yfwtw_-ES2g/viewform" rel="noopener">Envíanos tus comentarios</a></p>

Thanks!

Deb

 

 

0


image avatar

Trapta Singh

Zendesk LuminaryCommunity Moderator

Hi @Deb Chatigny,

That's right. You can create DC for text i.e. 'Send us your feedback' with English and Spanish variant. Then you can use it in a way as @wes suggested in the comment above.

Let me know if you face any issue.

Team Diziana

0


This still isn't working for us. In our article template, we include this dynamic content:

<p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform" rel="noopener">Send us your feedback</a></p>

I added the &entry.241692674={{article.title}} query parameter to it:

<p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform/&entry.241692674={{article.title}}" rel="noopener">Send us your feedback</a></p>

The result is that the URL includes the literal article.title and not the value of article.title.

https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform&entry.241692674=%7B%7Barticle.title%7D%7D

Any thoughts?

0


image avatar

Trapta Singh

Zendesk LuminaryCommunity Moderator

Hi @Ggoodman,

Try creating DC for "Send us your feedback" text only and in your template code use:

<p><class = "wysiwyg-font-size-medium"><a href="https://docs.google.com/forms/d/e/1FAIpQLSc7gBPOUV9Uz2pxytaX2czLANA-qQrUONq3O6EoKyA-ACGF9A/viewform/&entry.241692674={{article.title}}" rel="noopener">USE_YOUR_DC_HERE</a></p>

Let me know if you face any issue.

Team Diziana

0


Post is closed for comments.

Didn't find what you're looking for?

New post