Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple images/banners per position #11

Open
Tangol opened this issue Oct 5, 2021 · 0 comments
Open

Multiple images/banners per position #11

Tangol opened this issue Oct 5, 2021 · 0 comments

Comments

@Tangol
Copy link

Tangol commented Oct 5, 2021

At the moment, the plugin allows us to add only 1 Image/Script per banner.
It would be nice if we had the option to upload multiple images per every banner, as we'll have cases where a partner wants to promote 2 or more products on the same banner position.

For this I was using a simple JS that allowed me to show random banners on each page reload, based on a predefined list.
Example:

<script type="text/javascript">
	var imageUrls = [
		"https://www.5banners.com/store/img/cms/00045.gif" , 
		"https://www.bannereasy.com/assets/templates/2/1071.png"
	];
	var imageLinks = [
		"http://www.stackoverflow.com" , 
		"http://www.google.com"
	];

	function tangoAdBoxTall() {
		var dataIndex = Math.floor(Math.random() * imageUrls.length);
		var img = '<a href=\"' + imageLinks[dataIndex] + '"><img src="';
		img += imageUrls[dataIndex];
		img += '\" title=\"Your Text!\"/></a>';
		return img;
	}
</script>
<script type="text/javascript" defer>
	document.write(tangoAdBoxTall());
</script>

Maybe this can be adapted to the Banners plugin.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant