Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-11-10 20:00:40

Zarabadoo
Member
From: Denver, CO
Registered: 2004-03-14
Posts: 28
Website

Re: Template Files and Naming conventions

One thing to consider is the sightings of theme support. If there is going to be such a thing, a solid standard for compiling them would be good. The sooner we can make a solid standard, the easier such a system would be to develop. It would also allow for a nice library of working template packages if/when such a system shows. It is definitely long term thinking, but it would probably be beneficial for the community to get it done.

Now, I am not a PHP/MySQL programmer by any means, so I do not know which would be simpler to deal with: multiple files or a single file. Either one should be fairly simple to deal with especially if you have an XML control file or something. The single file would work nicely since you could import it almost like a plugin. Just copy and past the code to the administration panel. Plus to the multiple files is that it does make it pretty easy for the developer to keep track of. Once done, he/she can just compile a simple XML control file to dictate what is what each file should be classified as (page, article form, link, form, etc.). It would also compensate for the images needed for a template since it would have to be zipped up anyway. You could still upload it via admin and just have it unpack and install on the server.

In nameing conventions, I always name my forms in the backend to reflect the project and never overwrite the default file short of the error page. I would like to see this sort of styling implemented.

Last edited by Zarabadoo (2006-11-10 20:02:27)


—Al “Zarabadoo” Steffen
http://www.zarabadoo.com

Offline

#14 2006-12-09 21:28:14

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Template Files and Naming conventions

marios,

I’m ready to start cranking out Themes for Textpattern, but before I do…

Since you’ve worked on the Textmate bundle, I ask for you advice as to how best to name pages, forms and styles for these new themes.

Thanks.

PS. mcw_templates appears to be the best mechanism I’ve found for export and import.

Offline

#15 2006-12-09 21:57:55

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: Template Files and Naming conventions

Great news, hcgtv. I am doing the same right now, working on a quite complex template port to be released under GPL.
(testing now and ironing out the glitches)
When you do an export session with mcw_templates, you will notice, that the forms all have the form type prepended before the real file extension.
That was a very clever move from mike’s side to include this feature in the second plugin version.
The file extension can be set at the beginning of the plugin code.
(In your backend, those are not visible of course , since when you reimport they are stripped off again)
(They must match of course for an import session)

So for instance, an article form then could be:

gen_default

For an export session mcw then appends .article.txfml to it, since I have set it like that in the plugin prefs.
IMPORTANT: For a user to be able to successfully import a template set, those respective form delimiters must be present
in your template form files, when you package them up:
blabla.file.ext, something.comment.ext, etc ( for the 5 different form categories )
(But since you are building your template sets right from TXP, there is practically no need for it)

File Extensions

Now, because the Bundle relies on custom file extensions for some of its commands, I had invented a convention for my own needs.
I don’t know if this is feasible but it did work for me.

.txfml for forms, and .txpml for pages, and .css for css.

Folders

Forms, Pages and CSS are in their respective folders (lowercase)
which are:
forms, pages, css.

I’m not that certain myself , what’s best, that’s why I opened this thread.
The Port’s Template name for instance, that I am working on right now, is called Generico.
I am integrating zem_contact and bab_newsletter into it, so for the corresponding Subscriber Submit Form, I made up
gen_bab_zem_subscribe.
(I’d rather have used a three character creator index, but there wasn’t any)

There’s more info available in the online documentation , if you are interested, for the file extensions:

regards, marios

Last edited by marios (2006-12-09 23:37:35)


⌃ ⇧ < ⌃ ⇧ >

Offline

Board footer

Powered by FluxBB