CMS Development

PrasadKD
参加者

Code for Preventing Edit in Content Editor

解決

I just use some modules in one of the page. I just coded it like this. 

 

{% module 'blog_comments_heading'
path='@hubspot/header',
label='Blog comments heading',
header_tag='h3',
value='Leave a Comment'
%}

 

I want to prevent this from editing in Content editors. what code i have to add?

0 いいね!
1件の承認済みベストアンサー
Oezcan
解決策
トップ投稿者 | Diamond Partner
トップ投稿者 | Diamond Partner

Code for Preventing Edit in Content Editor

解決

Hey @PrasadKD 

 

Unfortunately I couldn't find anything that you need to add to prevent the content from being changed. But I have an alternative. To do this, you have to write your own module and just switch this on in the editing area.

 

1.

Oezcan_0-1642069070686.png

2.

Oezcan_1-1642069097837.png

 

3. And you link this module in your template.

Oezcan_2-1642069306333.png

 

I hope,I hope I could help.

Best regards,

Özcan

 

 

Oezcan Eser Signature

元の投稿で解決策を見る

2件の返信
Stephanie-OG
キーアドバイザー

Code for Preventing Edit in Content Editor

解決

I know this post is kinda old but I came across it and figured I'd answer in case anyone else comes looking for the answer. You can use the overrideable=false parameter, so it'll look something like this: 

 

{% module 'module_name'
   path='../modules/module-name',
   overrideable=false
%}

 

See the documentation here and I also wrote a quick post called Prevent editing in content editors in coded HubSpot templates for reference.


Stephanie O'Gay Garcia

Freelance HubSpot CMS Developer

Website | Contact

Oezcan
解決策
トップ投稿者 | Diamond Partner
トップ投稿者 | Diamond Partner

Code for Preventing Edit in Content Editor

解決

Hey @PrasadKD 

 

Unfortunately I couldn't find anything that you need to add to prevent the content from being changed. But I have an alternative. To do this, you have to write your own module and just switch this on in the editing area.

 

1.

Oezcan_0-1642069070686.png

2.

Oezcan_1-1642069097837.png

 

3. And you link this module in your template.

Oezcan_2-1642069306333.png

 

I hope,I hope I could help.

Best regards,

Özcan

 

 

Oezcan Eser Signature