Skip Navigation
Expand
Using a variable for an image directory
Answer ID 1519   |   Last Review Date 01/08/2019

How do I use a variable as the first part of an image path, such as:
$image = <img SRC="http://domain.com/directory

Environment:

Answers, Variables
Oracle Service Cloud, Knowledge Base Answers

Resolution:

You can use an answer variable to define the directory name where your image files are stored. This makes it easy to create links to images within several answers.

You can add a variable (named dir, for example), similar to the following:

<img src="http://domain.com/directory/sub-directory/sub-sub-directory

Do not include a slash at the end of the variable. The slash is what will indicate to Oracle Service Cloud where the variable ends and your text begins.

Then in your answer, you can enter $dir/image_name.gif"> to include your image. Be sure to include the closing HTML wicket (>) so that the HTML is properly coded. Preview your answer prior to publishing to confirm the image displays correctly.

Available Languages for this Answer:

Notify Me
The page will refresh upon submission. Any pending input will be lost.