On 17/12/2013 7:32 PM, Neeraj Dhiman wrote:
Hi Josh,
               Thanks for replying . My home page is mezzanine default
home page and don't think so its in mezzanine page tree. Actually my
requirement is I want to show some dynamic data ( articles ) on home
page (landing page). So If we cannot call page processors on home pages
then can you let me know the best suitable way to show dynamic data on
home page without loosing any default functionality of home page.

If the articles are just rich-text content, you could try a plugin like mezzanine-blocks and add the relevant stuff to your index.html template.

Or if you want blog posts to appear on the home page (similar to how they appear on /blog/ ) then you can put the appropriate code into the index.html template too.

Here's a snippet from mine (which uses both of the above approaches. richflatblock is a tag from mezzanine-blocks )

===============
{% block main %}
{% richflatblock "Home Page Top" %}

{% blog_recent_posts 3 as recent_posts %}
{% if recent_posts %}
<div class="panel">
<h2><a href="/blog">Latest News</a></h2>
{% for blog_post in recent_posts %}
<h3>
    <a href="{{ blog_post.get_absolute_url }}">{{ blog_post.title }}</a>
</h3>
<h6>
    {% trans "Posted by" %}:
    {% with blog_post.user as author %}
<a href="{% url "blog_post_list_author" author %}">{{ author.get_full_name|default:author.username }}</a>
    {% endwith %}
    {% with blog_post.categories.all as categories %}
    {% if categories %}
    {% trans "in" %}
    {% for category in categories %}
<a href="{% url "blog_post_list_category" category.slug %}">{{ category }}</a>{% if not forloop.last %}, {% endif %}
    {% endfor %}
    {% endif %}
    {% endwith %}
{% blocktrans with sometime=blog_post.publish_date|timesince %}{{ sometime }} ago{% endblocktrans %}
</h6>
<div class="recent-summary">
{{ blog_post.content|safe|truncatewords_html:100 }}
<p class="blog-list-detail">
    <a href="{{ blog_post.get_absolute_url }}">{% trans "read more" %}</a>
</p>
</div>
{% endfor %}
<p><a href="/blog"><i>Read more news</i></a></p>
</div>
{% endif %}

{% richflatblock "Home Page Bottom" %}
{% endblock %}
==============

Hope this helps.

Seeya. Danny.


--
Email: [email protected]

--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to