Skip Navigation
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="


Answers, Variables
Oracle B2C Service, Knowledge Base Answers


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="

Do not include a slash at the end of the variable. The slash is what will indicate to Oracle B2C Service 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.