Opened 9 years ago

Last modified 6 years ago

#4779 new enhancement

Clone post or template support

Reported by: Ilmars Poikans Owned by: osimons
Priority: normal Component: FullBlogPlugin
Severity: normal Keywords:
Cc: Ryan J Ollos Trac Release: 0.11


I'm using FullBlog plugin and it works well. But I have few very similar type of posts and it would be very helpfull, if there would be support for blog post templates.

Probably "template support" can be done very simple - by adding "Clone" button to every post for all users who can create new posts or make one more clone permission type. User can tag all templates for easy finding and broswing, for example, Templates or any other tag.

Anyway sometimes Clone button can make life easier even if you need to clone just once.

Attachments (0)

Change History (4)

comment:1 Changed 9 years ago by Ilmars Poikans

Currently I have found semi-solution, which is hacky with limitation and not nice - to put link somewhere in Trac

all values must be urlencoded of course.

It would be much nicer and I hope very easy to progam (reusing most of the code and with minimal additional code), if Clone button would pass additional parameter to create, so it know that it must clone post and load field values from post with name X from table in db. Maybe passing version id of post won't hurt.

comment:2 Changed 9 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed

comment:3 Changed 8 years ago by Ryan J Ollos

I'd find the template feature to be useful if it were implemented similar to t:PageTemplates in the Trac wiki.

comment:4 Changed 6 years ago by anonymous

I implemented this thusly:

from datetime import date 
<             if field in ['template']:
< 		tname = fields[field]
< 		cnx = self.env.get_db_cnx()
< 		cursor = cnx.cursor()
< 		sql = 'SELECT bname,title, categories, body FROM blog_template WHERE tname = "%s"' % tname
< 		cursor.execute(sql)
< 		row = cursor.fetchone()
< 		if row:
< 			cdate =
< 			setattr(self, 'name', cdate.strftime(row[0]))
< 			setattr(self, 'title', cdate.strftime(row[1]))
< 			setattr(self, 'categories', row[2])
< 			setattr(self, 'body', row[3])
< 			changes_made = True

Have to create the entries in the sql by hand .. but quite useful.

Modify Ticket

Change Properties
Set your email in Preferences
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.