콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3155 화면

Hi everyone

I have a website page with a <code></code> block inside. Inside this code block is some code that has < and > symbols:

#include <Wire.h>

I can't write it like this because then Odoo complains that there is a XMLSyntaxError: Opening and ending tag mismatch when I try to update my module.

I also tried writing it like:

#include &lt;Wire.h&gt;

But then odoo renders the <Wire.h> as HTML code and creates a <Wire.h></Wire.h> block inside my <code></code> block...

Does anyone know any solution for this?   

아바타
취소
베스트 답변

A (not beautiful) solution is to use a variable, and then t-esc this one.

<t t-set='mytext' t-value='#include &lt;Wire.h&gt;</t>'/>
<t t-esc='mytext' />
아바타
취소
베스트 답변

you can use cdata symtax in xml file, for example:

<field name='text_field><![CDATA[
Within this Character Data block I can
use double dashes as much as I want (along with <, &, ', and ")
*and* %MyParamEntity; will be expanded to the text
"Has been expanded" ... however, I can't use
the CEND sequence. If I need to use CEND I must escape one of the
brackets or the greater-than sign using concatenated CDATA sections.
]]>
</field>

on website template you can use "t-raw" or "t-ecs" for render this value:
https://www.odoo.com/vi_VN/forum/help-1/question/what-is-the-difference-between-t-esc-and-t-raw-92184



  




아바타
취소
관련 게시물 답글 화면 활동
1
3월 23
13569
0
12월 24
51
1
2월 24
851
0
12월 23
989
0
8월 22
2551