# Ignition Perspective Ad Carousel

**URL:** <https://forum.inductiveautomation.com/t/ignition-perspective-ad-carousel/91475>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 6, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-ad-carousel/91475 "2024-06-06T13:26:41Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Jacob\_Leonard](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Jacob\_Leonard](https://forum.inductiveautomation.com/u/Jacob_Leonard)\
**Post date:** [June 11, 2024, 12:32pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-ad-carousel/91475/6 "2024-06-11T12:32:21Z")

</div>

```python
import os

def imagePath(imageNameList, folderPath):
	imageViewList = []
	for x in range(len(imageNameList)):
		imageViewList.append(
		{
			"viewPath": "AdView",
			"viewParams": {
				"imagePath": "/Ads/"
			},
			"direction": "row",
			"justify": "flex-start",
			"alignItems": "flex-start"
		})
		imageViewList[x]['viewParams']['imagePath'] = folderPath + imageNameList[x]
	return imageViewList
	

folderPath = "C:/Program Files/Inductive Automation/Ignition/webserver/webapps/main\Ads"
localFolderPath = "/Ads/"
imageNameList = os.listdir(folderPath)
data = imagePath(imageNameList,localFolderPath)
system.tag.writeBlocking(["[default]Ad Data"], [data])

```

This is the script I ended up using. I am storing the ads images in the Webserver Webapp folder, using [this](https://forum.inductiveautomation.com/t/display-local-image-file-in-perspective/24953/3) trick and I write the new Ad Data to a document tag called "Ad Data" and bind that value to the data component of the carousel.

~~The Webserver Webapp trick has interesting issues. I can drag in new ads just fine, but I can not delete them as the windows operating system marks them as in use by the java process. I get around this by a bat script starting and stopping the ignition process. The operators of this station will just need to stop the ignition process before they update the ads and restart it.~~

 

Start bat script:  
`net start "Ignition"`

~~Stop bat script:  
 `net stop "Ignition"`  
 ~~  
Because I am using a Carousel, I can change "lazyLoading" set to False. This seems to bypass this issue.

---

_[View the full topic](https://forum.inductiveautomation.com/t/ignition-perspective-ad-carousel/91475)._
