Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom templates are not loaded when using Javascript Plugin #376

Open
hejazizo opened this issue Aug 3, 2022 · 2 comments
Open

Custom templates are not loaded when using Javascript Plugin #376

hejazizo opened this issue Aug 3, 2022 · 2 comments

Comments

@hejazizo
Copy link

hejazizo commented Aug 3, 2022

Hey,

Without javascript plugin everything looks fine and I'm able to have my custom templates.

When I load it though and add the line <div id="comments"></div>, the templates are gone and it loads it with the default templates which I can't find even in the django-comments-xtd library installation directory.

Has anyone had this experience? Does javascript plugin only comes with no template support and only loads its own default template?
Screen Shot 2022-08-03 at 11 32 24 AM

I also have tried this:

<div id="comments">
{% render_xtdcomment_tree for object allow_flagging allow_feedback show_feedback %}
</div>

Still no template loading.

@hejazizo
Copy link
Author

hejazizo commented Aug 3, 2022

When I load

<script
    type="text/javascript"
    src="{% url 'javascript-catalog' %}">
</script>

templates are gone.

@danirus
Copy link
Owner

danirus commented Aug 6, 2022

Hi @hejazizo, Yes, that's the expected behaviour with this particular JavaScript plugin, because it's written using ReactJS and it takes "advantage" of the JSX syntax, but it comes at the expense of not using the Django templates. I like how easy it is to write code the ReactJS framework, but I would also like if the JavaScript plugin used the Django templates.

I have been working for quite some time already in the version 3.0.0 of django-comments-xtd, and recently I created a new django app based on it. I created a new app because there are enough differences to make such a fork. The new app is django-comments-ink, and its JavaScript plugin uses Django templates. The plugin is written in vanilla JavaScript.

There is a Django project that shows how it works, the dci-project-stories. I am still adding features and writing the docs. But the README.md of that project might be enough to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants