Streaming live at 10am (PST)

Change Font within dynamic collection


#1

I d like to have a collection that defines different brand elements.
When switching between those brands i d like to have my dynamic cms site to have a different font for each brand. Is that possible with native ways of the cms / dynamic elements or maybe only with a js / jq workaround?

Regards
Daniel

e.g. you have a product page, that holds a dynamic collection with porsche and crysler. but

www.xyz.com/products/chrysler - should have another font because of its ci definitions than
www.xyz.com/products/porsche ....


Here is my public share link: LINK
(how to access public share link)


#2

I had to use script, but its working ....

<script>
var url = window.location.href;
var test = url.substring(url.lastIndexOf('/') + 1);

$('document').ready(function() {
	$.detectfont = function(x) {
		if (test == 'brand1') {
  		$(".css-class-name-of-text").css("font-family", "brand1-font-name");
  	} else if (test == 'brand2') {
  		$(".css-class-name-of-text").css("font-family", "brand2-font-name");
  	}
	}
  $.detectfont();
});
</script>