Hi! Recently i was pointed that i can use a "slug" keyword to tell blogging bundle to set post slug. And it was fine with one minor problem - Fetch Post command doesn't fetch that slug... It even fetches tags (keywords) for WordPress 2.3 but no slug. So I decide to try to tune blogging bundle for myself. And it was not very hard. Here is a result (blogging.rb file, line 405 aprox.):
doc += "Title: #{self.post['title']}\n" #added: this line will populate slug back to post doc += "Slug: #{self.post['wp_slug']}\n" if self.post['wp_slug'] doc += "Keywords: #{self.post['mt_keywords']}\n" if self.post['mt_keywords']
I tested it only with Wordpress 2.3 (i use it) so try it with care ;)
P.S. Why I need it? I often use post headers like "Вообще-то, я ждал Франции..." (russian) and then set a slug like "waiting-for-france". And sometimes i edit my post and forget to write slug again. And post slug become something like this: "%d0%b2%d0%be%d0%be%d0%b1%d1%89%d0%b5-%d1%82%d0%be-%d1%8f-%d0%b6%d0%b4%d0%b0%d0%bb-%d1%84%d1%80%d0%b0%d0%bd%d1%86%d0%b8%d0%b8". Plus from this point i can't send link to my friends (that didn't so happy to own Mac) becouse Safari shows it like "http://nilcolor.prosound.fm/2007/11/21/%D0%B2%D0%BE%D0%BE%D0%B1%D1%89%D0%B5-..." - yep, with pure russian chars in address bar :)
P.P.S Hope this change or better one will be implemented asap in svn copy of blogging bundle.
On 21 Nov 2007, at 19:08, Alexey Blinov wrote:
[...] set a slug like "waiting-for-france". And sometimes i edit my post and forget to write slug again. And post slug become something like this [...]
Your patch is sane, just wanted to ask; shouldn’t this be considered a WP bug?
I.e. when updating a post, and a header is not provided, WP should use the stored value for this header, rather than “calculate” it -- similar to how leaving out date will not bump the date of the post to now(), but rather use the date the post was already given the first time it got posted.
On Nov 21, 2007 9:18 PM, Allan Odgaard throw-away-2@macromates.com wrote:
Your patch is sane, just wanted to ask; shouldn't this be considered a WP bug?
I.e. when updating a post, and a header is not provided, WP should use the stored value for this header, rather than "calculate" it -- similar to how leaving out date will not bump the date of the post to now(), but rather use the date the post was already given the first time it got posted.
Hm... Maybe. But im not sure that blogging bundle didn't send header/title again when post is changing... Anyway its good to have slug back after post is submitted via Command+Control+D
On 21 Nov 2007, at 19:51, Alexey Blinov wrote:
On Nov 21, 2007 9:18 PM, Allan Odgaard throw-away-2@macromates.com wrote:
Your patch is sane, just wanted to ask; shouldn't this be considered a WP bug?
I.e. when updating a post, and a header is not provided, WP should use the stored value for this header, rather than "calculate" it -- similar to how leaving out date will not bump the date of the post to now(), but rather use the date the post was already given the first time it got posted.
Hm... Maybe. But im not sure that blogging bundle didn't send header/title again when post is changing...
WP sends back title + slug, TM then updates the post, sending back only the title. At least as long as the title is the same, WP should IMO not generate a new slug (effectively a new permalink).
Anyway its good to have slug back after post is submitted via Command+Control+D
I have now committed it -- I was not against the patch, just, your problem IMO is caused by behavior I think should be changed in WP.
On Nov 26, 2007 6:54 PM, Allan Odgaard throw-away-2@macromates.com wrote:
On 21 Nov 2007, at 19:51, Alexey Blinov wrote:
WP sends back title + slug, TM then updates the post, sending back only the title. At least as long as the title is the same, WP should IMO not generate a new slug (effectively a new permalink).
I post a support topic at WP forum so hope they can fix it.
I have now committed it -- I was not against the patch, just, your problem IMO is caused by behavior I think should be changed in WP.
Thank you.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate