Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Theme mechanism for TxP 4.0.X
marios, I think mod_rewrite is the cleanest, no need to worry about packaging empty index.html files.
hakjoon, does the Textpattern templating system allow accessing images and javascript files from outside it’s own web root?
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Theme mechanism for TxP 4.0.X
hcgtv wrote:
hakjoon, does the Textpattern templating system allow accessing images and javascript files from outside it’s own web root?
*slaps forehead* D’oh nevermind.
Last edited by hakjoon (2007-03-18 16:30:40)
Shoving is the answer – pusher robot
Offline
Re: Theme mechanism for TxP 4.0.X
I had a very productive weekend, finally got some needed rest today.
The Theme Mechanism I propose does work in the light of day, after making sure by going through the core code. I can see where a true templating system would require some more tweaks but that’s up to the dev team, cause there’s just too much hard coded stuff in the core.
Importing Pages, Forms and Styles with a template name as a prefix, the Pages and Style tabs are fine, since we’re talking 2 pages and a style. The Forms tab can get a bit confusing, since there are 8 defaults showing up plus whatever your new template requires. So I ask, can I modify the templates plugin to add a toggle to the Forms tab for turning off the display of the defaults? Any advise on this would be most helpful, cause I’m a newbie on the TxP plugin scene.
Now, I know what I’m doing may seem a bit foreign to regular TxP users. They’ve become accustomed to using one set of default templates on the backend, cause it’s how the core code works. There is no distinction of a template set, like other systems have, it’s more like this is your install, these are your forms, have at it. Then comes the forum posts, I screwed something up, how do I restore the defaults? In my opinion, the defaults should be locked down, want to deviate from the defaults, create a new form and tweak it to your liking.
I still need to do some tidying up and then I’ll begin creating some templates, my goal is to spit out a termplate a week, either from a freely available XHTML template or from a rival system’s most popular downloads. Also, I’d like to take some of the best templates from Textgarden and the other Textpattern template sites and adjust them to work with this new mechanism, if that’s cool.
There are differing ways to tackle a templating system, where the files are stored, how do we name the pages, forms and styles, etc. I’ve seen too many threads on these forums go on infinitum and nothing concrete comes of it, so I’d rather put into practice what I preach and I hope that one day all our differing ways meet up at a true templating system, I’m game.
Last edited by hcgtv (2009-08-29 04:46:15)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Theme mechanism for TxP 4.0.X
Wow, Bert, that was all pretty quick… Well done.
Offline
Re: Theme mechanism for TxP 4.0.X
Great work Bert – following it with much interest…
Offline
Re: Theme mechanism for TxP 4.0.X
Things to keep in mind for a future templating system:
- The error_default page and search_results form are hardcoded.
- The forms tab needs to include only the template you’re working with, for now I’ve removed the sorting by type in txp_form.php and just sort by form name, easier to work with, especially when you have the defaults plus two templates installed.
- The comments system needs a thinking over, there’s three forms for commenting, can get a bit confusing. One thing that may help users is to include all commenting styling elements in the default.css, less view source, more copy pasting.
- There is no way to tell if you’re on the Home page, no matter what txp:if tag I used. So for custom titles, breadcrumb lines, etc., you’re searching forum posts for answers and installing a plugin.
- Plugins are powerful but the basics should be handled by the core, I’d rather distribute a plugin with a template for added functionality rather from necessity.
I’m almost done with a new template, all in all, I really like the txp:tag mechanism, it’s very powerful. I’ve worked with many systems in the past, TxP is hands down is the best I’ve worked with.
I’ve updated my templates wiki page with the above finds, at least it’s somewhere to write down my thoughts.
Last edited by hcgtv (2009-08-29 04:47:21)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Theme mechanism for TxP 4.0.X
More finds at the end of the road:
- The error_default page must link to specific style, n=“style name”
- Was able to get around the search_results form by using the searchform attribute of the article tag.
- The popup_comments tag calls by default the popup_comments form which calls comments_display, hard coded.
Relevant forum threads:
I believe that’s it, not a huge hurdle to overcome.
The template is finished, installs in 5 minutes time – FileZilla taking the bulk ;)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
#20 2007-03-22 22:27:45
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Theme mechanism for TxP 4.0.X
…search_results form are hardcoded.
Offline
Re: Theme mechanism for TxP 4.0.X
Mary wrote:
Post right above yours:
hcgtv wrote:
- Was able to get around the search_results form by using the searchform attribute of the article tag.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Theme mechanism for TxP 4.0.X
Necessity is the mother of all inventions…
TxP IDE comes to life.
Last edited by hcgtv (2009-08-29 04:58:58)
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Theme mechanism for TxP 4.0.X
You are putting a lot of work in, Bert! It will be tremendous if templates can be put in place in just a few minutes! Some of you TXP folk are geniuses!
Re naming conventions, I will be happy to use whatever formula gets agreed upon. But here are my preferences, for what they are worth. I don’t like the idea of adding new extensions. To me, it just seems to add to confusion and overload. I also like things alphabetical for easy scanning and finding. Perhaps this does not matter if template installation is to be automated, but anyway here is my suggestion:
kubk1_forma_somearticleform.txt
kubk1_formm_somemiscform.txt
kubk1_formc_comment_form.txt
kubk1_image_fancy.jpg
kubk1_page_default.txt
kubk1_page_archive.txt
kubk1_plugin_zem_contact.txt
kubk1_style_default.txt
kubk1_style_fancy.txt
kubk1_write_urltitle1.txt
kubk1_write_urltitle2.txt
and maybe
kubk1_section_all.txt
kubk1_cata_name1.txt
kubk1_cati_name1.txt
kubk1 is a unique 5 character abbreviation for the template. With templates don’t most people put their name or link in the footer anyway, so I don’t see a need for author. 5 characters keeps it short.
forma_somearticleform.txt means it is a form, type article, with the name ‘somearticleform’. Same can be done with the others if needed.
write_urltitle1 means create a new article with a url-only title of title1.
section_all is there cos I used it with the Texty template. If it can be automated, perhaps using a convention within the txt file, fantastic!
cata_name1 means it is category article and called name1
cati_name1 means it is category image and called name1
That’s if the automator can create the category just from the name. If not then perhaps:
kubk1_cat_all.txt with a convention within the txt file.
This scheme means extra folders can be eliminated. Also remember that many, if not most, people wanting templates will not be technically inclined, so I think naming conventions should be as near to plain language as possible, so that’s why I’ve just used underscores and not hyphens or dots as well.
I’ve only created one template and may not create any more, so that is just the suggestion of a template newbie. But perhaps it will help.
Offline
Re: Theme mechanism for TxP 4.0.X
Bert, This is some really excellent work. I just did a test with crystalx, and I’m extremely impressed.
[edit] of course it’s going to be WAY easier when the section tab improves… …click drag release… …click drag release… save…. for each section. ;)
Last edited by mrdale (2007-03-26 16:37:12)
Offline