If you signed up before Aug 9, 2021, please click Previous plans to view your applicable plans.

Dynamic placeholders are a set of variables that can be replaced with the actual values. Freshdesk provides a set of placeholders you can use to customize your customer portal themes using the code editor. For a general overview of Freshdesk themes and how you can customize them, see Customize Portal Appearance (Themes).

 

For example, you can use the {{portal.articles_count}} in the Solutions () tag to display the total number of solution articles in your portal.


This article contains:


Placeholder categories

Freshdesk provides placeholders for the following categories:

  1. Global
  2. Solutions
  3. Forums
  4. Attachments
  5. Users
  6. Using snippets for critical behavior
  7. Multilingual Portal

Global

Includes placeholders you can use in your support portal or in the header or footer area. 

Placeholder

Return Type

What they mean

portal.namestringName or Title of the portal
portal.languagestringSelected language (English, French etc.)
portal.logo.urlurlDefault or Custom logo from the portal
portal.linkback.urlurlLinkback URL from Freshdesk
portal.contact.infourlPhone number specified in Freshdesk
portal.login.urlurlLogin URL of the support portal (also available to anonymous users)
portal.logout.url  Logout URL of the support portal (also available to anonymous users) 
portal.can.signup.featurebooleanTrue or false based on whether signups are allowed or not
portal.signup.urlurlSignup URL of the support portal
portal.new.ticket.urlurlURL to the new ticket creation page
portal.new.topic.urlurlURL to create a new forum topic
portal.my.topic.url   URL to the user's preferred topic
portal.profile.urlurlURL to the profile of a specific user
recent.articlescollection of articleslist of recently added articles across the portal
language.codestringCurrent language selected on the portal
language.namestringCurrent language selected on the portal
language liststringList of lang

Solutions

Includes dynamic placeholders specific to solutions articles to help your customers better.

Solution Categories

Includes placeholders specific to each solution category:

Placeholder

Return Type

What they mean

category.namestringName of the solution category
category.descriptionstringDescription of the solution category
category.idnumberUnique ID of the solution category
category.urlurlURL pointing to the solution category
category.folderscollection of foldersFolders in the category based on visibility
category.folders_countnumberFolders count in the category based on visibility


Solution Folders

Includes placeholders specific to Solution folders:

Placeholder

Return Type

What they mean

folder.namestringName of the solution folder
folder.descriptionstringDescription of the solution folder
folder.idnumberUnique ID of the solution folder
folder.urlurlURL pointing to the solution folder
folder.categorysolution categoryCategory in which the solution folder is contained
folder.articlescollection of articlesArticles inside the solution folder
folder.articles_countnumberCount of articles inside the solution folder
 visibility number 


Solution Articles

Includes placeholders specific to Solution articles:

Placeholder

Return Type

What they mean

article.titlestringTitle of the solution article
article.thumbs_upnumberNo of thumbs ups for a solution article
article.thumbs_downnumberNo of thumbs downs for a solution article
article.bodyhtmlThe body of the solution article including any formatting and images
article.body_plainstringThe body of the solution article in plain text
article.modified_ondate/timeThe time stamp pointing to when the solution article was last modified
article.created_ondate/timeThe time stamp pointing to when the solution article was originally created
article.idnumberThe Unique ID of the solution article
article.urlurlThe URL pointing to the article
article.tagsarray of objectsThe search tags that have been added to the solution article
article.attachmentsattachmentThe attachment(s) that are present in the solution article
article.cloud_filesarray of cloud filesThe cloud file attachment(s) that are present in the solution article
article.typestringThe type of the article (Permanent or Workaround)
article.folderstringThe folder in which the article is contained
article.categorystringThe category in which the solution article is contained
article.thumbs_up_urlurlThe URL which will increase the thumbs up of the article by one. Need to use a data-method=”put” attribute in the link to work.
article.thumbs_down_urlurlThe URL which will increase the thumbs down of the article by one.  Need to use a data-method=”put” attribute in the link to work.   
portal.recent_articlescollection of articlesThe list of recently added articles from across the portal
 related collection of articles 



Forums

Includes placeholders you can use to customize your Forums section.

Forum Categories

Placeholder

Return Type

What they mean

forum_category.namestringReturns the name of forum categories
forum_category.descriptionstringReturns the description of forum categories
forum_category.idnumberUnique ID of the forum category
forum_category.urlurlURL pointing to a forum category
forum_category.forumscollection of forumsForums in the category based on visibility
forum_category.forums_countforumForums count in the category based on visibility


Specific Forum

Placeholder

Return Type

What they mean

forum.namestringName of the forum
forum.descriptionstringDescription of the forum
forum.urlurlURL pointing to the forum
forum.idnumberUnique ID of the forum
forum.type_namestringType of the forum (announcement, ideas, problems, questions)
filter.list   
forum.current_topic_filterstringCurrently selected forum filter. Will work only in the respective filters page
forum.allowed_filters
Will return a hash with the below details
  • filter.name translated label of the filter
  • filter.url url link to the filter
forum.forum_categoryforum categoryCategory in which the forum is present
forum.topicslist of topicsList of topics in the forum
forum.topics_countnumberCount of all topics in the forum
forum.planned_topicstopicPlanned topics that are available only for the "ideas" forum
forum.popular_topicstopicList of popular topics
forum.answered_topics topicList of answered topics
forum.unanswered_topicstopicList of unanswered topics
forum.solved_topics topicList of solved
forum.unsolved_topicstopicList of unsolved topics
forum.implemented_topicstopicImplemented topics that are available only for a ideas forum
forum.nottaken_topicstopicNot taken topics that are available only for a ideas forum
forum.inprogresstopicIn progress topics that are available only for a ideas forum
forum.deferredtopicDeferred topics that are available only for a ideas forum


Specific Topic

PlaceholderReturn TypeWhat they mean
topic.titlestringTitle of the forum topic
topic.idnumberUnique ID of the forum topic
topic.stampstringStamp of the forum (planned, inprogress, deferred, implemented, not taken) comes only for forum type as ideas
topic.useruserUser who created the topic
topic.created_ondate/timeThe timestamp denoting when the topic was created
topic.votesnumberNo. of votes on a forum topic (can be “I like this idea”, “I have this question” or “I have this problem”)
topic.viewsnumberNo. of views on a forum topic
merge boolean 
topic.lockedbooleanReturns true or false based on whether the topic is locked or not
topic.stickybooleanReturns true or false based on whether the topic is a sticky (that will appear on the top)
topic.answeredbooleanReturns true or false based on whether the topic has been answered to or not
topic.has_commentsbooleanReturns true or false, used to check if the topic has any comments or not
topic.postspostList of posts inside the topic
topic.comment_countnumberNumber of comments that have been created under a topic
topic.first_postpostThe first post in the topic, which was created by the original creator
topic.last_postpostThe last reply of the topic which is the latest in the list
topic.urlurlURL to a particular topic in the forum
topic.forumforumThe forum in which a topic is contained
topic.attachmentsattachmentThe attachments that have been made to a topic
topic.last_post_urlurlURL to the last reply made to the forum topic
topic.voted_by_current_userbooleanForum topics in which users have voted (can be “I like this idea”, “I have this question” or “I have this problem”)
topic.like_urlurlThe URL used to like a particular topic.  Need to use a data-method=”put” attribute in the link to work.
topic.unlike_urlurlThe URL used to unlike a particular topic.  Need to use a data-method=”put” attribute in the link to work.
my_topicsstringList of topics that have been created or currently being followed by the user
my_topics_countnumberNumber of topics that have been created or currently being followed by the user


Specific Post on the topic

PlaceholderReturn TypeWhat they mean
post.idnumberUnique ID of the post
post.bodystringPlain text version of the post
post.body_htmlhtmlHtml version of the post
post.created_ondate/timeTime stamp referring to when the post was originally created
post.useruserInformation about the user who created the post
post.topictopicThe topic in which the post is contained
post.answerbooleanReturns true or false based on whether there can be answers on the post or not
post.attachmentsattachmentThe attachment(s) that are available in the post
post.urlurlThe unique URL of the post  

Attachments

You can customize how your pages (and users) access attachments in your solutions and forums. For example, you can create a layout that will automatically show the thumbnail of the first image attachment with the solution’s overview. Any image attachments will automatically create a corresponding thumbnail as well.

Placeholder

Return Type

What they mean

attachment.urlurlURL to the attachment
attachment.thumbnailurlPreview image of the attachment file
attachment.extensionstringThe file extension of the attachment (.doc, .jpg etc)
attachment.filenamestringThe filename of the attachment without the extension
attachment.sizenumberFile size of the attachment
attachment.is_imagebooleanReturns true or false based on whether the attachment is an image or not  

Users

Provides placeholders to define anything related to your users and how they access your portal. Remember, users refer to both Requestors as well as your Customers in Freshdesk.

Placeholder

Return Type

What they mean

portal.user.namestringFull Name of the user using the support portal
portal.user.firstname
portal.user.lasttname
string Returns the first name and last name of the user respectively 
portal.user.emailemailEmail address of the user
portal.user.phonenumberPhone number of the user
portal.user.mobilenumberMobile Number of the user
portal.user.job_titlestringJob title of the user
portal.user.time_zonestringThe time zone that has been configured in the user’s profile
portal.user.profile_urlurlThe URL pointing to the profile of the user
portal.user.idnumberUnique ID of the user
portal.user.company_namestringCompany name that has been specified in the user’s profile
portal.user.is_agentbooleanReturns true or false based on whether the user is an agent or not

Using snippets for critical behavior

You can use ready-made snippets in your to enhance your support operations. For example, instead of updating the layout of the new ticket form, you can include the corresponding snippet and improve the behavior.


Portal Wide Snippets

Placeholder

Return Type

What they mean

snippet new_ticket_formhtmlIncludes the new ticket form into the page
snippet new_topic_formhtmlIncludes the new topic form into the page
snippet signup_formhtmlIncludes the signup form into the page
snippet login_formhtml

Placeholder for Language Switcher 


In the portal, users have the option to switch between the supported languages by using the language switcher.

Includes the login form into the page
snippet forgot_password_formhtmlIncludes the forgot password form into the page
snippet search_formhtmlIncludes the search from into the page


Topic detail page snippets

Placeholder

Return Type

What they mean

snippet topic_replyhtmlIncludes the topic reply form into the page
snippet topic_votehtmlIncludes the voting buttons into the page  

Multilingual Portal

If you have Multilingual Support on the portal, you can use the following additional dynamic placeholders and code snippets for language support.


Placeholder for Language Switcher: {{ portal | language_list }}

Generates the language switcher on the portal. 


If your portal is configured to support multiple languages, customers can use the language switcher option on the customer portal. The placeholder will be automatically included with appropriate styles when {{ portal | welcome_navigation }} is already available. If not available, add the code manually for the language switcher.

Note: To ensure that the styles match your brand, it is always recommended to check the changes in draft mode before publishing it.


Placeholder for Dynamic Text: {{ portal.current_language.code }} or {{ portal.current_language.name }}

Use this to translate any hardcoded text on the support portal, such as the page header, title, or footer based on the language selected by the users.


For example, if your portal header text is "Hi, how can we help you?" translated text can be added based on the current portal language selection using {{ portal.current_language.code }} or {{ portal.current_language.name }}.


Here is an example code that needs to be used on your portal customization code:

<h1>
{% if portal.current_language.code == "en" %}
We are here to help!
{% elsif portal.current_language.code == "fr" %}
Nous sommes ici pour aider!
{% elsif portal.current_language.code == "de" %}
Wir sind hier um zu helfen!
{% endif %}
</h1>

View and use dynamic placeholders

To access and use the placeholders.

  1. Go to Admin > Portals and click on the Edit icon next to any portal.
  2. Switch to the Appearance tab. You will see your current live theme and other available themes. Click Edit theme
  3. Switch to the Pages tab. You will see the different portal pages and the corresponding CSS code on the code editor.
  4. To use the placeholders for further customization, click on the Insert placeholder button within the code editor. You can see the different categories of dynamic placeholders.
  5. Use them to personalize your customer portal. Once you've done so, click Publish