Friday, December 22, 2017

Re: Search results in template


<blogpost start>  <article class="blogpost">  	<header>  		{% for object in object_list %}  		<h2><ahref="{{ object.get_absolute_url }}">{{ object.title }}</a></h2>  			<div class="post-info">  				<span class="post-date">  					<i class="icon-calendar"></i>  						<span class="day">{{object.chron_date}}</span>  							<span class="month">{{object.clock}} </span>  	</span>  <span class="submitted"><i class="icon-user-1"></i> by <a href="#"></a></span>  <span class="comments"><i class="icon-chat"></i> <a href="#">22 comments</a></span>  									</div>  	</header>  		<div class="blogpost-content">  			{{ object.content|truncatewords:30 }}</div>  				<footer class="clearfix">  					<div class="tags pull-left"><i class="icon-tags"></i> <a href="#">tag 1</a>, <a href="#">tag 2</a>, <a href="#">long tag 3</a></div>  	<div class="link pull-right"><i class="icon-link"></i><a href="{{ object.get_absolute_url }}">Read More</a></div>  				</footer>  </article>  		<!-- blogpost end-->  		{% endfor %}    Any assistance in getting the search results to show up greatly appreciated.  --

There is still an issue with the HTML from what I can see, your {% for %} loop starts within an <article> tag, but the </article> tag is within the {% for %} loop, so you are trying to create multiple article entries, but only the first has an opening <article> tag. Not sure how/if that affects the display of the results.

The point from my previous goof still stands, do your results show within the rendered page HTML, but just aren't being displayed?

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciV56ORGwDeap7nser4RwSE3gdZVXPgREMU%3Dzw8g6YDx2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment