Jump to content

Disable frontend-editing if other format then HTML?


dragan
 Share

Recommended Posts

I just noticed that PW will output frontend-editing markup, even if I output JSON.

Is there a way I can disable that, from inside my template?

I use classic switch/case statements and URL-segments to output different content, HTML + JSON, in the same template. I know that my JS modules will not see all that extra markup, and guest users neither.


[{"title":"Joe Doe","firstName":"<span id=pw-edit-1 class='pw-edit pw-edit-InputfieldText' data-name=firstName data-page=1161 style='position:relative'><span class=pw-edit-orig>Joe<\/span><span class=pw-edit-copy id=pw-editor-firstName-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>Joe<\/span><\/span>","lastName":"<span id=pw-edit-2 class='pw-edit pw-edit-InputfieldText' data-name=lastName data-page=1161 style='position:relative'><span class=pw-edit-orig>Doe<\/span><span class=pw-edit-copy id=pw-editor-lastName-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>Doe<\/span><\/span>","teamEmail":"<span id=pw-edit-3 class='pw-edit pw-edit-InputfieldEmail' data-name=teamEmail data-page=1161 style='position:relative'><span class=pw-edit-orig>akbari@inspire.ethz.ch<\/span><span class=pw-edit-copy id=pw-editor-teamEmail-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>joe.doe@foo.ch<\/span><\/span>","office":"<span id=pw-edit-4 class='pw-edit pw-edit-InputfieldText' data-name=office data-page=1161 style='position:relative'><span class=pw-edit-orig>PFA E 91<\/span><span class=pw-edit-copy id=pw-editor-office-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>PFA E 91<\/span><\/span>","phone":"<span id=pw-edit-5 class='pw-edit pw-edit-InputfieldText' data-name=phone data-page=1161 style='position:relative'><span class=pw-edit-orig>+41 44 123 45 67<\/span><span class=pw-edit-copy id=pw-editor-phone-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>+41 44 123 45 67<\/span><\/span>"}]

But when working on a PW site, it would be cool to somehow not see this.

Is there a setting for this? Do I have to add something to my selector?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...