givanz / VvvebJs

Drag and drop page builder library written in vanilla javascript without dependencies or build tools.
https://www.vvveb.com/vvvebjs/editor.html
Apache License 2.0
7.28k stars 1.66k forks source link

unable to use library with django #122

Open jindalAnuj opened 4 years ago

jindalAnuj commented 4 years ago

{%=key%}

the above keywords are there in editor.html
can anybody help me with that

Actually problem is that it is javascript or html way to use variables but i am not able to find out which format is that . These are conflicting with jinja2 ( A django template engine)

rmnprt commented 4 years ago

It's using a custom template engine. See this.tmpl under libs/builder/builder.js, that's the handler that gets called when it needs to render a template. Theoretically you can change {% to say <% and %} to %> to avoid conflicting with the other library you're using.

jindalAnuj commented 4 years ago

@rmnprt ha ha lol i just figured it out in the morning Well Thanks for reply

Marchamp commented 4 years ago

@rmnprt ha ha lol i just figured it out in the morning Well Thanks for reply

Were you able to figure it out? I am facing the same issue. I tried replacing almost all {% and %} with <% and %> respectively. Didn't work.

Forchapeatl commented 1 year ago

Did any one figure this out ? @jindalAnuj , please how did you go about it ?

givanz commented 1 year ago

To avoid conflict with jinja or similar template engines you need to change the template tags from https://github.com/givanz/VvvebJs/blob/master/libs/builder/builder.js#L24-L25

  var startTag = "@%";
  var endTag = "%@";

Then do a global search replace in https://github.com/givanz/VvvebJs/blob/master/editor.html#L837 and replace {% with @% and %} with %@

adarshaady commented 7 months ago

I installed the vvvebjs library in Django, we encounter an error when importing components, such as ImportError: cannot import name 'ButtonBox' from 'vvvebjs'.

Steps Followed:

The vvvebjs library was installed using the command "npm install vvvebjs".

I imported components such as "ButtonBox" from vvvebjs using the import statement.

Issue:

ImportError: cannot import name 'ButtonBox' from 'vvvebjs'.

can some one help me in resolving the above issue