Last updated: 2024-10-16

Source: https://support.freshdesk.com/support/solutions/articles/65042-use-dynamic-placeholders

Use Dynamic Placeholders

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
  • View and use dynamic placeholders
  • Placeholder categories

    1. Global 2. Solutions - Solution Categories - Solution Folders - Solution Articles 3. Forums - Forum Categories - Specific Forum - Specific Topic - Specific Post on the topic 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.

    PlaceholderReturn TypeWhat 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.urlLogout 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.urlURL 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:

    PlaceholderReturn TypeWhat 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:

    PlaceholderReturn TypeWhat 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
    visibilitynumber

    Solution Articles

    Includes placeholders specific to Solution articles:

    PlaceholderReturn TypeWhat 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
    relatedcollection of articles
  • Forums

    Includes placeholders you can use to customize your Forums section.

    Forum Categories

    PlaceholderReturn TypeWhat 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

    PlaceholderReturn TypeWhat 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\_filtersWill return a hash with the below details<br>- filter.name translated label of the filter<br>- 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\_topicstopicList of answered topics
    forum.unanswered\_topicstopicList of unanswered topics
    forum.solved\_topicstopicList 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
    mergeboolean
    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.

    PlaceholderReturn TypeWhat 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.

    PlaceholderReturn TypeWhat they mean
    portal.user.namestringFull Name of the user using the support portal
    portal.user.firstname<br>portal.user.lasttnamestringReturns 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

    PlaceholderReturn TypeWhat 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\_formhtmlPlaceholder for Language Switcher <br>In the portal, users have the option to switch between the supported languages by using the language switcher.<br>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

    PlaceholderReturn TypeWhat 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:

    ```html

    ```

    HTML

  • 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.