Is there any interest in moving the page generation of Jukebox to a template manager, like Smarty?
I've been using Slash as a company intranet webpage for a while now -- it uses the Template Toolkit, which is awesome. However, for mod_php it seems that Smarty is what you need.
I've moved some of the HTML into templates and have them working now on my Jukebox installation... At the end of the day, templates would help keep the HTML out of the code -- and if the presentation ever needed to be modified, it could be done much easier by modifying the templates.
Any interest in this? Not sure how far I will get with it, but I am starting it now...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One thing that worries me about Smarty is its installation (http://smarty.php.net/manual/en/installing.smarty.basic.php): it would appear to add quite a few complex steps to the installer process, especially the extra directories needed outside the document root.
Installation aside, this does look like an excellent idea: it appears to have the potential to abstract the entire skinning system away from the PHP code, which (aside from the obvious cleaning up of the code) would allow the end-user to add skins without having to touch the core code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> it would appear to add quite a few complex steps
> to the installer process, especially the extra
> directories needed outside the document root
Yes, this is very true. For most end users it may be tricky... The Template Toolkit, what Slash (and Slashdot) is using, seems like it is more flexible, but I have no idea if it will work with mod_php. I think you've got to be using mod_perl, but I have no idea. Maybe it will work...(?)
Using Gentoo, I just did an "emerge smarty" and had it up and running in no time. I did have to create the directories inside the jukebox tree as you mentioned.
Slash also puts the templates INTO the MySQL database, providing a neat little front end from the browser to even change the templates from the webpage. This may be overkill for the small number of templates that the Jukebox requires, and I'm not sure it's even possible with the Smarty directory structure...
At any rate, I'm no Perl expert, so it will take a while, but as you mentioned... Changing the font for the entire site could be easy if the templates have a global "font" tag or something like that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I've spent a good half of the day and learned a lot about both PHP and Smarty, and got the "insertAlbumCoverArt" function converted. In the process I've added a couple of new things. The code and a screenshot are here for now:
Interested to hear any comments. My personal feeling is that the templates will clean up the code significantly, making it more manageable and making the presentation much easier to modify.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there any interest in moving the page generation of Jukebox to a template manager, like Smarty?
I've been using Slash as a company intranet webpage for a while now -- it uses the Template Toolkit, which is awesome. However, for mod_php it seems that Smarty is what you need.
I've moved some of the HTML into templates and have them working now on my Jukebox installation... At the end of the day, templates would help keep the HTML out of the code -- and if the presentation ever needed to be modified, it could be done much easier by modifying the templates.
Any interest in this? Not sure how far I will get with it, but I am starting it now...
One thing that worries me about Smarty is its installation (http://smarty.php.net/manual/en/installing.smarty.basic.php): it would appear to add quite a few complex steps to the installer process, especially the extra directories needed outside the document root.
Installation aside, this does look like an excellent idea: it appears to have the potential to abstract the entire skinning system away from the PHP code, which (aside from the obvious cleaning up of the code) would allow the end-user to add skins without having to touch the core code.
> it would appear to add quite a few complex steps
> to the installer process, especially the extra
> directories needed outside the document root
Yes, this is very true. For most end users it may be tricky... The Template Toolkit, what Slash (and Slashdot) is using, seems like it is more flexible, but I have no idea if it will work with mod_php. I think you've got to be using mod_perl, but I have no idea. Maybe it will work...(?)
Using Gentoo, I just did an "emerge smarty" and had it up and running in no time. I did have to create the directories inside the jukebox tree as you mentioned.
Slash also puts the templates INTO the MySQL database, providing a neat little front end from the browser to even change the templates from the webpage. This may be overkill for the small number of templates that the Jukebox requires, and I'm not sure it's even possible with the Smarty directory structure...
At any rate, I'm no Perl expert, so it will take a while, but as you mentioned... Changing the font for the entire site could be easy if the templates have a global "font" tag or something like that.
Well, I've spent a good half of the day and learned a lot about both PHP and Smarty, and got the "insertAlbumCoverArt" function converted. In the process I've added a couple of new things. The code and a screenshot are here for now:
http://wskellenger.home.comcast.net/jukebox/index.html
Interested to hear any comments. My personal feeling is that the templates will clean up the code significantly, making it more manageable and making the presentation much easier to modify.