2

Set up your dropdown so that the Option Labels are default, yellow, green, etc. and the Values are page-project, page-project bg-yellow, page-project bg-green, etc. Then, you can {% set bodyClass = entry.backgroundColor %} This will set bodyClass to whatever the value is for the chosen dropdown element, i.e. page-project if you pick the default option.


1

In Craft, assets are always "absolute" paths to the webroot, not relative to the URL (although you can make it like that). So in your example, @AssetPublicPath/images is going to be replaced with https://dev-craft3-f59ef5d673d0.hyperlane.co/uploads/images. If you want something to go into a subfolder, in this case work, you'd need to either specify ...


1

I found the answer in this thread Dropdown field value getting outputted multiple times The correct syntax to achieve what I am trying to do is: {% if entry.backgroundColor.value == "default" %} {% set bodyClass = "page-project" %} {% elseif entry.backgroundColor.value == "yellow" %} {% set bodyClass = "page-project ...


Only top voted, non community-wiki answers of a minimum length are eligible