gone through again but still need help; missing something and can't figure 
it out ...
the goal is to get the first 50 characters from a published page onto the 
index page
so

index.html

  {% include "teaser.html" %}

teaser.html

  {% load page_teaser_tags keyword_tags mezzanine_tags i18n %}

  {% block page_teaser %}
  {% page_teaser "about-us" as teased_page %}
  {% if teased_page %}
  {% teased_page %}
  {% endif %}
  {% endblock %}

page_teaser_tags.py

from __future__ import unicode_literals

from mezzanine.pages.models import Page
from mezzanine import template

register = template.Library()

@register.as_tag
def page_teaser(page=None):
    """
    return the requested page
    usage
    {% page_teaser page="about-us" as page_teased %}
    """

    pages = Page.objects.published()
    if page is not None:
    try:
        page_teased = pages.filter(slug=page)
    except page_teased.DoesNotExist:
        return []
    return render(page_teased.description)

my templatetags\page_teaser_tags.py never gets triggered at all (meaning 
there is no compiled python file in the folder)
however i do reach the "teaser.html" file but can't passed it no matter 
where i place my tag file

thx
Roland

 

-- 
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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to