Opened 15 years ago
Last modified 5 years ago
#5573 new enhancement
Cutting tag (former "Is it possible to manually split "header" and "body" of blogpost?")
Reported by: | Owned by: | osimons | |
---|---|---|---|
Priority: | high | Component: | FullBlogPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Hi!
I published some images into my blog and them took a lot of pages, I'd like to make only one visible in list of posts and others - be available under cutline. Is it possible to accomplish this with FullBlogPlugin?
Thank you.
Attachments (2)
Change History (8)
comment:1 Changed 15 years ago by
Priority: | normal → high |
---|---|
Summary: | Is it possible to manually split "header" and "body" of blogpost? → Cutting tag (former "Is it possible to manually split "header" and "body" of blogpost?") |
comment:2 Changed 15 years ago by
comment:3 Changed 15 years ago by
I'm not sure if this is the same thing as what you have been discusing, but sounds similar to me ... I'd find it useful to have an option to hide images from the Recent Postings sidebar generated by [[BlogList]]
`.
comment:4 Changed 14 years ago by
I needed a cut option in order to show previews of long posts. I decided to keep it simple so I set the rule that the first horizontal rule (WikiFormatting "----") is the cut point.
I then added a simple bit of code to fullblog_macro_post.html to slice the body when a horizontal rule is found. I've attached the patch I use.
comment:5 Changed 14 years ago by
Server refuses to accept the diff file: rejects it as spam. Same thing happens if I try to add it as text manually. user-friendly, not! In the following text the link element causes the wobble so I've manually edited the element name 'a' to 'b' - change that to make it work.
-
tracfullblog/templates/fullblog_macro_post.html
a b 6 6 py:strip="not list_mode">${post.title}</a> 7 7 </h1> 8 8 <div class="blog-body" xml:space="preserve" 9 py:with="do_shorten = defined('blog_max_size') and len(post.body) > blog_max_size"> 10 ${wiki_to_html(context(post.resource), do_shorten and post.body[:blog_max_size] + ' ... ' \ 9 py:with="cut_at = post.body.find('----')"> 10 <py:with vars="do_shorten = (cut_at > 0) or (defined('blog_max_size') and len(post.body) > blog_max_size)"> 11 ${wiki_to_html(context(post.resource), do_shorten and post.body[:cut_at if cut_at>0 else blog_max_size] + ' ... ' \ 11 12 or post.body)} 12 13 <p py:if="do_shorten"><b href="${href.blog(post.name)}">(Read more)</a></p> 14 </py:with> 13 15 </div> 14 16 <ul class="metainfo" py:if="not defined('show_meta') and True or show_meta"> 15 17 <li class="metadates">Posted: ${format_datetime(post.publish_time, '%Y-%m-%d %H:%M')}
Changed 14 years ago by
Attachment: | cut_at.patch added |
---|
Implement cut at first horizontal rule ( spam-trap avoidance: to use patch do sed 's/<b/<a/')
Changed 14 years ago by
Attachment: | cut_at.2.patch added |
---|
Implement cut at first horizontal rule ( spam-trap avoidance: to use patch do sed 's/<b/<a/')
comment:6 Changed 14 years ago by
Use cut_at.2.patch - it doesn't cut posts unless list_mode is true, which means single posts don't get snipped.
It will be more useful to support cutting tag in post, like cut, to divide post in 2 parts. I really need that feature because we use FullBlogPlugin to discuss art in our projects.