VvvebJs icon indicating copy to clipboard operation
VvvebJs copied to clipboard

unable to use library with django

Open jindalAnuj opened this issue 6 years ago • 7 comments
trafficstars

{%=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)

jindalAnuj avatar Nov 13 '19 04:11 jindalAnuj

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.

rmnprt avatar Nov 13 '19 06:11 rmnprt

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

jindalAnuj avatar Nov 13 '19 06:11 jindalAnuj

@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.

Marchamp avatar Oct 17 '20 02:10 Marchamp

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

Forchapeatl avatar May 27 '23 22:05 Forchapeatl

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 %@

givanz avatar May 28 '23 11:05 givanz

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

adarshaady avatar Mar 25 '24 13:03 adarshaady