Modify

Opened 5 years ago

Last modified 4 years ago

#5573 new enhancement

Cutting tag (former "Is it possible to manually split "header" and "body" of blogpost?")

Reported by: prokher@… 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)

cut_at.patch (1.2 KB) - added by linux@… 4 years ago.
Implement cut at first horizontal rule ( spam-trap avoidance: to use patch do sed 's/<b/<a/')
cut_at.2.patch (1.2 KB) - added by linux@… 4 years ago.
Implement cut at first horizontal rule ( spam-trap avoidance: to use patch do sed 's/<b/<a/')

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by digitbrain@…

  • Priority changed from normal to high
  • Summary changed from Is it possible to manually split "header" and "body" of blogpost? to Cutting tag (former "Is it possible to manually split "header" and "body" of blogpost?")

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.

comment:2 Changed 5 years ago by mitar

I would also vote for this. I like [blog:cut] idea. This would probably be easiest to implement. And could also be additional way of going around wrong cuts in #3069. And maybe even #4358. (As this cut should also reset text formatting.)

comment:3 Changed 5 years ago by rjollos

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 4 years ago by linux@…

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 4 years ago by linux@…

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.

--- a/tracfullblog/templates/fullblog_macro_post.html +++ b/tracfullblog/templates/fullblog_macro_post.html @@ -6,10 +6,12 @@

py:strip="not list_mode">${post.title}</a>

</h1> <div class="blog-body" xml:space="preserve"

  • py:with="do_shorten = defined('blog_max_size') and len(post.body) > blog_max_size">
  • ${wiki_to_html(context(post.resource), do_shorten and post.body[:blog_max_size] + ' ... ' \

+ py:with="cut_at = post.body.find('----')"> + <py:with vars="do_shorten = (cut_at > 0) or (defined('blog_max_size') and len(post.body) > blog_max_size)"> + ${wiki_to_html(context(post.resource), do_shorten and post.body[:cut_at if cut_at>0 else blog_max_size] + ' ... ' \

or post.body)}

<p py:if="do_shorten"><b href="${href.blog(post.name)}">(Read more)</a></p>

+ </py:with>

</div> <ul class="metainfo" py:if="not defined('show_meta') and True or show_meta">

<li class="metadates">Posted: ${format_datetime(post.publish_time, '%Y-%m-%d %H:%M')}

Changed 4 years ago by linux@…

Implement cut at first horizontal rule ( spam-trap avoidance: to use patch do sed 's/<b/<a/')

Changed 4 years ago by linux@…

Implement cut at first horizontal rule ( spam-trap avoidance: to use patch do sed 's/<b/<a/')

comment:6 Changed 4 years ago by linux@…

Use cut_at.2.patch - it doesn't cut posts unless list_mode is true, which means single posts don't get snipped.

Add Comment

Modify Ticket

Action
as new The owner will remain osimons.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.