Hello everyone, I am new to Modx and I was hoping I could get some help figuring out this of code.
Here is the background, I am trying to make my website that has a different background image depending on which page it displayed. I have my css setup as a document in my resources and in my mind the easiest way to make this work would be to use the IF snippet and create an If statement that calls up the chunk of code with the background in it depending on what the page ID was.
Long story short is that it works... unfortunatly it is only reading the id of the css document. Can anyone help me get the if statement to us the id of the page being displayed instead of the css document that is being used?
Template Code (About Page is id#3)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>[[*pagetitle]] | [[++site_name]]</title>
<link rel="stylesheet" type="text/css" href="[[~4]]">
</head>
CSS Code (If statement only works if operand=`4`)
body {
[[If? &subject=`[[*id]]` &operator=`equals` &operand=`3` &then=`[[$aboutBg]]`]]
margin:0;
}
AboutBg chunk
background: #d0652f url(../assets/images/a_bg.jpg) repeat-x top center;
Thanks in advance for your help