Modify

Opened 15 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@… 13 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@… 13 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 15 years ago by digitbrain@…

Priority: normalhigh
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?")

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 14 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 14 years ago by Ryan J Ollos

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 13 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 13 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.

  • tracfullblog/templates/fullblog_macro_post.html

    a b  
    66        py:strip="not list_mode">${post.title}</a>
    77    </h1>
    88    <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] + ' ... ' \
    1112          or post.body)}
    1213        <p py:if="do_shorten"><b href="${href.blog(post.name)}">(Read more)</a></p>
     14        </py:with>
    1315    </div>
    1416    <ul class="metainfo" py:if="not defined('show_meta') and True or show_meta">
    1517      <li class="metadates">Posted: ${format_datetime(post.publish_time, '%Y-%m-%d %H:%M')}
Last edited 4 years ago by Ryan J Ollos (previous) (diff)

Changed 13 years ago by linux@…

Attachment: cut_at.patch added

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

Changed 13 years ago by linux@…

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 13 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain osimons.

Add Comment


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

 
Note: See TracTickets for help on using tickets.