Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
I have a Bootstrap 4 framework page which runs perfectly including the Couch 'require' and 'invoke' PHP. However, as soon as I add an editable region I get this:-
"ERROR! ATTRIB_VALUE: Invalid first char "�" (line: 97 char: 3769)" (although the cms directive is actually on line 99 in VSC).
This is the small block of code:-
Code: Select all
<cms:editable name=’main-text' label='Main text' type='richtext'>
   <p>
   To enter the competition simply use our <a href="contactpage.html">Contact Us
   </a> form and put the one word COMPETITION in the message field. We'll then send you a link and login details.
   </p>
</cms:editable>

Seems totally simple and uncomplicated. I have used Couch on another site with no problems! Any suggestions please?
Not sure where you got it from but the opening 'quote' you are using for the 'name' param is actually not the single-quote that is expected to be used - it sure looks like one but is actually a 'unicode' character (u2019).
Please try comparing it with all the other quotes in your code and, I think, you'll be able to spot the difference :)

Anyway, following is the rectified code you may use -
Code: Select all
<cms:editable name='main_text' label='Main text' type='richtext'>
   <p>
   To enter the competition simply use our <a href="contactpage.html">Contact Us
   </a> form and put the one word COMPETITION in the message field. We'll then send you a link and login details.
   </p>
</cms:editable>

Apart for the problematic code, another change that I had to do with the code above is change the 'name' of the editable region from 'main-text' to 'main_text' (the hyphen is not a valid character for names so had to replace it with an underscore).

Hope this helps.
Thanks KK; on the ball as usual. It's been a while since I created a new CMS page but, even so, I don't know how that erroneous damned single quote appeared. So easy to overlook in several hundred lines of code even when you know it's localised :-(

Totally forgot about the naming convention of course.

Anyway, problem solved - thanks again!
You are welcome :)
4 posts Page 1 of 1