Looking for 'Hemingway' Port :)

Skinning and designing Serendipity (CSS, HTML, Smarty)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Looking for 'Hemingway' Port :)

Post by garvinhicking »

Hi!

I just stumbled accross the WP theme 'Hemingway' (http://warpspire.com/hemingway), which I find very interesting as it doesn't follow usual blogging guides.

This would be a quite interesting theme to port to Serendipity, because it's very unique...

Any takes who want to make me happy with such a port? :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel »

I second this request - it's a really cool theme. :)
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

That's great that you guys like it... :lol: you may have your wish granted, but have you seen the backend of that template. It uses the same type of drag and drop as the new plugin management for Serendipity so that has to be integrated into the config area of the s9y port, then you have to make sure the user has the plugins installed, and if they don't, how do you do a lookup to see what they have installed, and then how do you warn them that their template won't display correctly. Answer those questions and ...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

No, I have not seen the backend of that template, only the frontend. :)

In the config.inc.php of the template's file you could check using "if (class_exists('serendipity_event_XXX'))" to add items to the $config array depending on the installed plugins.

You could create a simple smarty function

Code: Select all

function serendipity_smarty_isPlugin($class) {
 if (class_exists($class)) return true;
 return false;
}

function serendipity_smarty_hasPlugin($params, &$smarty) {
 if (class_exists($params['class'])) return true;
 return false;
}

$serendipity['smarty']->register_function('serendipity_smarty_hasPlugin', 'serendipity_smarty_hasPlugin');
$serendipity['smarty']->register_modifier('serendipity_smarty_isPlugin', 'serendipity_smarty_isPlugin');
In your template you could use:

Code: Select all

{if 'serendipity_event_XXX'|serendipity_smarty_isPlugin}
 ... put a plugin here using hookPlugin smarty ... 
{/if}
?

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

ok, I'll try that, but the backend of hemingway still has the drag and drop options for plugins. Basically it has three columns under the main overview/detail page, and the drag and drop allows the user to select which plugin will go into each column. If we are going to develop hemingway for s9y, it should probably have that function in the config area.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Why not use the usual plugin manager in the s9y frontend? One could use three columns (left, hidden, right) to indicate the various positions for the hemingway template?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

But the hidden column has a specific purpose - to hide things. On my own blog I regularly hide html nuggets if I want to try different things, saves having to retype everything.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Well, making the left/right/hidden concept different would be really some amount of work to do.

...30 minutes later...

Okay, maybe it isn't. I've prepared a patch, which I can sadly not try without my development machine. :(

Anyone willing to testdrive it? What it should do is support a new config.inc.php template option called 'sidebars'. This holds a comma-delimited string value of sidebar names. Like "left,right,top,bot,hide". Note two things: Don't use spaces, don't use descriptors longer than 6 characters. Make sure you also use the default value of the $template_config['sidebars'] to indiciate an order.

Have a look at the docs/NEWS entry I added to describe the option. I hope it works as smoothly as I imagine it to work.

You can then use your custom side name ("top" or "bot") as usual in the smarty function call: {serendipity_printSidebar side="bot"} etc.

Here's the patch:

http://garv.in/serendipity/pluginmanager.diff

A TGZ including those files (from an 1.1-alpha4 version):

http://garv.in/serendipity/pluginmanager.tgz

Carl, I hope you like it. You really know how to motivate me, do you? :) I think this is a MAJOR cool new feature to the theme configurator in the 1.1 branch.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

I'll try it out, do I need to use the latest nightly snapshot or will any verion of 1.1 be ok?
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Garvin, it works! Beautifully, the half an hour you spent doing this is well worth it!!! And now that I've seen it working, you're right, this is MAJOR, with extra big capital letters.

In the configure plugin screen, the original sidebars (left, hide, right) are fixed width and the sidebar title is lowercase, whereas the new sidebars are squeezed to fit in and the titles are uppercase. If you could fix this it would be awesome. EDIT: I was wrong, the first three columns are fixed width, then the rest are squeezed into the remaining space, but I'm also using 1280 wide monitor so maybe its different for other people.

Once again, good work, now I have to go and play with hemingway. Hope nobody else beats me to it :D
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Ok, another problem, if you select a plugin goes into a new sidebar (top, bot) and then change templates, or alter the config.inc.php, it can lose the plugin and then it needs to be reinstalled. I think that by default if a plugin is installed but the sidebar its attached to is missing, then it should autoimatically be placed into hidden until the user can reassign it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Carl!

That'S true, this possible error can happen. I think I wrote about it either in the blog entry or in the s9y wiki documentation.

Your suggestion of putting those 'missing' plugins into hidden is a good one, but coding it is more time than just the 30 minutes previously. I'll try to work on that the next week!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Good work Garvin, and maybe by then Hemingway will be ready to release as well. Its going well, the start page is coded, now I need to figure out a way of coding the archives/overview page without destroying the design. Unfortunately Hemingway doesn't actually display an overview page, it only does an archive page with entry title and date. I could just ignore this but I figure people like this template because it is so different, so I really need to stick with the original design. I'm posting progress reports on my blog.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

I've posted a couple of screenshots of the progress on porting hemingwayif anyone is interested.
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel »

That seriously looks awesome, Carl! I can't wait for this to be released. :D
Post Reply