[mezzanine-users] a page summary with a link to the whole page
Hi group; I want to know how is it possible to create page and just put it summary and a link to it on my home page. How to achieve this ? -- 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.
[mezzanine-users] Re: Page menu - Cartridge product categories as root pages ?
As I understand it, this happens in PageMiddleware (pages/middleware.py) which is responsible for coming up with a page to add to the template context. This happens as well for non-page views, like blog pages and shop products, in which case the page that gets added to the context is the root blog or shop page. For shop products, I think a useful feature would be to have the context page be the category with the deepest (most specific) path. So if a product was in Shop Mens Wear Shirts and Shop Mens Wear (as a featured product), then when viewing the product, the page set in the context would be Shirts, so that the breadcrumbs then showed Shop Mens Wear Shirts and not (as happens at present) Shop. So, the question is how best to achieve this, presumably by modifying PageMiddleware in some way. On Friday, May 22, 2015 at 11:11:51 PM UTC+10, David Unric wrote: Hello, how can I configure/tweak Mezzanine *cartridge.shop.models.Product* won't be prefixes with *Shop* in menus and breadcrumbs ? For example I've created product category Pages named Cars and Acessories and each product belongs only to one of them. Both categories are rendered as root in page_menu pages/menus/tree.html (bellow Shop), links in category view (including nested ones) correspond to current category in a categories tree. So far so good. However when navigate to a specific product, instead of real parent categories path, page_menu places product directly as a descendant of *Shop*, which is not correct. It seems the logic is in Mezzanine's pages_tags.py in pages/templatetags, but having a harder time to completely understand it, incl. where *menu_pages* in context comes from etc. I do not know if I'am on the right track and would welcome if anybody can give me an advice how Cartridge products to be linked as descendants of their primary category instead of a generic Shop ? Thanks. -- 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.
Re: [mezzanine-users] a page summary with a link to the whole page
On 23/05/2015 9:12 AM, Jean de la Croix Ki wrote: Hi group; I want to know how is it possible to create page and just put it summary and a link to it on my home page. How to achieve this ? My home page shows some of the summaries of the blog posts on the front page - you could probably do this in your template for other pages as well. The key thing, I think, is the 'truncatewords_html' filter that Django provides, it allows you show a short snippet from another page/other content. In my index.html template: {% block main %} {% blog_recent_posts 3 as recent_posts %} {% if recent_posts %} div class=panel h2a href=/blogLatest News/a/h2 {% for blog_post in recent_posts %} h3 a href={{ blog_post.get_absolute_url }}{{ blog_post.title }}/a /h3 h6 class=post-meta {% 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 %} {% 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 %} pa href=/blogiRead more news/i/a/p /div {% endif %} {% endblock %} Hope this helps! Seeya. Danny. -- 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.