Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Currently having an issue where the values from input fields are popping up on my web page, and I can't seem to find what might be putting them there.

The below code snippet is the (clumsy) way that I'm allowing someone to set either a colour value or image as the background on a web page.

    - background_type allows the user to select what kind of background they want (colour or image)
    - background_image lets them upload the image
    - background_col lets them enter a colour value
    - the background_type is set to a variable
    - If statement will create a div with the relevant background information depending on what the user selected as the background_type

Everything functions fine but I get this text appearing in the top-left side of my screen:

Image

This text is values that have been dropped in on the cms side. 'hex' is one of the option values, and 'white' is the colour that was input. If I select "Image" and drop in an image, it displays "img" and the url. Does anyone know why this might be happening?

Code: Select all
<cms:editable name='background_cust' label='Background Customisation' desc='Set the background of the page' type='group' />

<cms:editable
  name="background_type"
  label="Background Type"
  desc="Which type of background would you like to use?"
  type="radio"
  opt_values="Colour (HEX)=hex | Background Image (URL)=img"
  group="background_cust"
/>

<cms:editable
  name="background_image"
  label="Background Image"
  desc="Upload/Selct an image to use"
  type="image"
  group="background_cust"
/>

<cms:editable
  name="background_col"
  label="Background Colour (Hex)"
  desc="Enter a colour code to use"
  type="text"
  group="background_cust"
  width='150'
/>

<cms:set bgtype="<cms:get 'background_type' />" />

<cms:if bgtype = 'hex'>
  <div id="bg" data-bg="<cms:get 'background_col'/>"></div>
</cms:if>

<cms:if bgtype = 'img'>
  <div id="bg" data-bg="url('<cms:get 'background_image'/>') 50% 50% /cover no-repeat"></div>
</cms:if>
2 posts Page 1 of 1

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 1 guest