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

sekizai tag addtoblock silently ignored #98

Closed
jpVm5jYYRE1VIKL opened this issue Sep 21, 2020 · 4 comments
Closed

sekizai tag addtoblock silently ignored #98

jpVm5jYYRE1VIKL opened this issue Sep 21, 2020 · 4 comments

Comments

@jpVm5jYYRE1VIKL
Copy link
Contributor

After installation fresh version of django cms . Appeared that Sekizai tag render_block and addtoblock just silently ignored and entries defined in template between addtoblock entryes does not appear in resulting html document.

templates which illustrate issue :

newbase.html

{% load cms_tags menu_tags sekizai_tags i18n %}
<!doctype html>
{% get_current_language as LANGUAGE_CODE %}
<html lang="{{ LANGUAGE_CODE }}">
    <head>
        <title>{% block title %}This is my new project home page{% endblock title %}</title>
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <meta charset="utf-8">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
        <link rel="shortcut icon" type="image/png" href="{{ STATIC_URL }}/favicon.ico"/>
        {% render_block "css" %}
    </head>
    <body>
        {% cms_toolbar %}
        {% block content %}{% endblock content %}
        {% render_block "js" %}
    </body>
</html>

extendinpage.html


{% extends "newbase.html" %}
{% load cms_tags sekizai_tags %}

{% block title %}{% page_attribute "page_title" %}{% endblock title %}


{% block js %}
	{% addtoblock "js" %}
	<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
	<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
	{% endaddtoblock %}
{% endblock js %}

{% block content %}
	{% placeholder "content" %}
{% endblock content %}

Resulting html page source in browser look like :


 <!doctype html>

<html lang="en">
    <head>
        <title>Home</title>
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <meta charset="utf-8">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
        <link rel="shortcut icon" type="image/png" href="/static//favicon.ico"/>
        

    </head>
    <body>
        
        
	<p>home content</p>

        

    </body>
</html>

 

@jpVm5jYYRE1VIKL
Copy link
Contributor Author

Project dead ?

@macolo
Copy link
Sponsor

macolo commented Sep 22, 2020

hi @jpVm5jYYRE1VIKL no the project is not dead. :) This looks like a configuration mistake?

Can you try using the addtoblock tag inside your normal content blocks, your js block is very likely just ignored (it doesnt exist in the base template).

@jpVm5jYYRE1VIKL
Copy link
Contributor Author

sorry. Look like during reading documentation i lost. Examples on https://django-sekizai.readthedocs.io/en/latest/ look like not working. Most probably need to adjust it. I ll try to do PR but my English skills not good.

marksweb pushed a commit that referenced this issue Oct 29, 2021
* Update index.rst

Update main template to avoid confuse.

* Update index.rst
@greyhare
Copy link

greyhare commented May 2, 2023

This issue looks like it could be closed.

@marksweb marksweb closed this as completed May 2, 2023
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

4 participants