- 27 May 2022
- 5 Minuten te lezen
- Bijdragers
- Afdrukken
- DonkerLicht
- Pdf
Variables
- Bijgewerkt op 27 May 2022
- 5 Minuten te lezen
- Bijdragers
- Afdrukken
- DonkerLicht
- Pdf
When you use the same text-based content in multiple places which changes over some time, you can use variables to save time. Variables are text-based content that can be used in many instances and edited on the variables overview page. It also allows you to update the content easily.
For example, you want to add your contact information in multiple instances which might change over time. In this case, you can add a variable for contact information. If a change is required, instead of updating in all instances, you can just update the variable alone.
(Contact: +1 897564231 / support@serverless.com)
Adding a Variable
- Go to Content tools → Content reuse → Variable
- The Variable overview page appears. If you have added any variables earlier, you can see them listed here
- Use the dropdown at the top to select language-specific variables (Global, English, French, etc.) added to your project
- Click on the New variable button on the top-right, and a Add new variable blade appears
- Type in a Name for your variable. The name can contain characters, numbers, hyphens, and underscore
Variable Name character limit is 30 characters.
- The Merge code value would be the actual tag that appears in your editor
For example, If your variable name is "Disclaimer", then your Merge code value would be {{variable.Disclaimer}}.
- If you want a particular variable to be available across all the languages, turn on the Global toggle
- If turned Off, you can select the available language from the Language dropdown, and the variable would be available only for that particular language
- In the Value, type in the content you want to add to the variable
Character limit for Variable Value
Variable Value character limit is 100 characters with spaces. If you want to add longer content, tables, or code blocks, use Snippets.
Formatting options
The below formatting options are available for variable content:
a. Basic text formatting options:
• Bold
• Italic
• Strikethrough
• Underline
• Font size
b. Other formatting options: Click on More text icon to access the below options
• Font Family
• Text color
• Background color
• Subscript
• Superscript
• Clear Formatting
c. Insert Link - To add a hyperlink.
- Click on Insert link icon
- Type in the URL and add a text for the URL in the Text field
- If required, select the Open in new tab checkbox
- Click Insert
- After entering the variable details, click on the Add button at the bottom-right
- The added variable appears on the Variable overview page
Using variables in an article/category page
You can add a variable between any sentence on the article/category page. There are two methods with which you could add a variable in your article/category page while editing.
Method 1
In the Markdown editor, type in variable.MergeCodeValue between closed double curly brackets
Example: {{variable.Disclaimer}}
But you must know the exact merge code value to add the desired variable.
Typing in variable.Merge Code Value would only work in the Markdown editor.
If you use the WYSIWYG editor, please follow Method 2 (mentioned below) to add a variable to your documentation.
(or)
Method 2
- Click on the { } Content reuse button in the Markdown or WYSIWYG editor and select the variable or use the Search variables bar to search for the variable name
- Select the intended variable(s) from the search list
- Click on the Insert button
You can select more than one variable to insert in your article/category page.
Variable overview page
You can view, edit, or delete a variable on the Variable overview page.
- Go to Content tools → Content reuse → Variable
- The Variable overview page appears. You can find the list of variables you have already added
a. Languages – To filter the variables in Global or a specific language
b. Name – Variable name. Click the column header to sort
c. Value – Content of the variable. Click the name entity to view it
d. Documents used – If a variable is not added to any article/category page, the status would be -. If a variable is added to any article/category page, you can click on the View button to see the list of articles/category pages that contain the variable. For more information, see View article/category page dependency
e. Edit - To edit the variable content
f. Delete - To remove the variable
View article/category page dependency
- In the Variable overview page, you can find the column Documents used
- Click on the View button, and a Articles/Categories used blade appears on the right
- On the blade, you can view the list of articles/category pages the variable has been added
- Click on the article to expand the section
- You can find the following information:
- The article version
- The project version and language
- The team account name and profile picture who has added the variable
- The article status (Published, Draft, New Article)
- The time/date information when the variable was inserted in the article/category page
Editing an existing Variable
- Click on Content tools → Content reuse → Variable
- The Variable overview page appears. You can find the list of variables you have already added
- Navigate the mouse over the variable you want to edit
- Click on the Edit icon next to the variable
- You can edit the content of the variable
- If the variable is not tagged in any article/category page, you can edit the global/local availability. If the variable is tagged in any article/category page, you cannot edit the global/local availability
- The Name and Merge Code Value cannot be edited
Click the link and you can find the following options:
Open link - The link will open in the tab. This helps in checking the link
Style - Style has two options.
- Green - To change the link text color to green
- Thick - To increase the thickness of the link text
Edit - To edit the URL, link text, and change open in new tab option
Unlink - To unlink the URL and change it to normal text. The URL will be unlinked and only the URL text will appear
- After you complete the content edit, click on the Update button
When you edit the value of an existing variable in the library, the value change will reflect in all the articles/pages inserted by the respective variable.
Deleting a variable
- Go to Content tools → Content reuse → Variable
- The Variable overview page appears. You can find the list of variables you have already added
- Navigate the mouse over the variable you want to delete
- Click on the Delete icon next to the variable
- In the Delete confirmation prompt, click Delete
If you have any article/category page dependency, you cannot delete a variable.
'Article/category page dependency - Variable is added in one or more articles/category pages.'
You must first manually remove the variable from those articles/category pages and then delete the variable.
Check out the tutorial video: