django - How can I set a custom Template for djangocms-blog? -
i have djangocms based website , have app small blog section.
now, have integrate djangocms-blog in website, when trying see post, template (a custom template made me) not rendered , post (made blog admin) thrown on page.
can me out issue ? additional info in order me out ?
my template looks this:
{% extends "base.html" %} {% load cms_tags %} {% block title %}{% page_attribute "page_title" %}{% endblock title %} {% block content %} <div class="spacer"></div> <div class="page-header page-header-blog-post-1 white"> <div class="page-header-container container"> <div class="page-header-content"> <h1 class="heading">blog</h1> </div> </div> </div> <div class="blog-container blog-single container"> <div class="row"> <div class="col-md-8 blog-content margin-bottom-70 clearfix"> {% placeholder banner_leaderboard_top %} </div> </div> <div class="row"> <div class="col-md-8 blog-content margin-bottom-70 clearfix"> <article id="post-1" class="post-1 post format-standard"> <header class="entry-header"> <div class="post-thumbnail-area"> {% placeholder "post_header_image" or %} <img src="/static/img/onepage-slide9.jpg" alt="image_blog"/> {% endplaceholder %} </div> </header> <div class="entry-content"> <div class="entry-title blog-info"> <h1 class="heading">{% placeholder "post_header_title" or %}post_title{% endplaceholder %}</h1> </div> {% placeholder "post_body" or %}post_body{% endplaceholder %} </div> <footer class="entry-footer"> <div class="entry-description"> <h6 class="post-date-classic">{% placeholder "post_date" or %}post_date{% endplaceholder %}</h6> </div> </footer> </article> <div class="post-additional"> <script type="text/javascript"> // popup window code function newpopup(url) { popupwindow = window.open( url, 'popupwindow', 'height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> <ul class="post-share list-inline"> <li><a href="javascript:newpopup('https://www.facebook.com/sharer/sharer.php?u='+window.location.href)"><i class="icon ion-social-facebook"></i></a></li> <li><a href="javascript:newpopup('http://twitter.com/home/?status=nice blog post - '+window.location.href);"><i class="icon ion-social-twitter"></i></a></li> <li><a href="javascript:newpopup('https://plus.google.com/share?url='+window.location.href); "><i class="icon ion-social-googleplus"></i></a></li> </ul> <div class="post-navigation nav-links"> <ul class="post-controls list-inline"> <li> {% placeholder "prev_post" or %} <a class="post-prev" href="#"><i class="icon ion-ios7-arrow-thin-left"></i></a></li> {% endplaceholder %} <li> {% placeholder "next_post" or %} <a class="post-next" href="#"><i class="icon ion-ios7-arrow-thin-right"></i></a></li> {% endplaceholder %} </ul> </div> </div> <div class="author-bio"> <div class="row"> <div class="author-avatar col-xs-4 col-sm-3 col-md-3 visible-desktop"> {% placeholder "author_img" or %} <img src="/static/img/image-8.jpg" alt="image_blog"></div> {% endplaceholder %} <div class="author-details white col-md-9"> <h3>{% placeholder "author_name" or %}author_name{% endplaceholder %}</h3> <p>{% placeholder "author_body" or %}author_body{% endplaceholder %}</p> </div> </div> </div> {% placeholder banner_leaderboard_bottom %} </div> <div class="col-md-4"> <div class="sidebar"> <aside id="recent-posts-2" class="widget widget_recent_entries"> <div class="widget-title"> <h5 class="heading">recent posts</h5> <div class="fancy-line-small"></div> </div> {% placeholder "post_recent" or %} <ul> <li><a href="#">recent blog post</a></li> </ul> {% endplaceholder %} </aside> {% placeholder banner_square_right %} </div> </div> </div> </div> {% endblock %}
some image administration of djangocms-blog:
so, i'd title blog admin applied on template instead of <h1 class="heading">blog</h1>
, on date
, category
, on
if want override template used app you've installed need mimic same template path in template directory.
the cms blog templates can found here.
so override cms blog templates should decide template needs overridden, in case sounds post_detail.html
because you're concerned how post displays.
so in project need create like; myproj/templates/djangocms_blog/post_detail.html
then system load 1 instead of post_detail.html
site-packages folder.
Comments
Post a Comment