Adding Images | Yext Hitchhikers Platform
What You’ll Learn
In this section, you will learn:
- How to add and reference images in your pages and cards
- How to add static files on your site
Adding Images
You might want to add custom imagery for the standard icons on your site: for example, the search bar icon, the title bar icons, or icons that appear on your cards.
In order to do this, you’ll need to add the images to your site so that they can be referenced.
Upload an image file to your
/static/assets/images
folder. Your images will have a path of/static/assets/images/filename.extension
.Reference the image with the following structure
static/assets/images/filename.extension
. You can use this wherever the library is expecting an image URL. Below is an example of referencing a custom icon replacing the Search Bar magnifying glass.
Code
"SearchBar": {
"placeholderText": "Search", // The placeholder text in the search bar
"customIconUrl": "static/assets/images/magnifying_glass.svg"
}
Result
Note - you must place images in the specific folder path (static/assets/images), otherwise they will not be accessible for use on your site.