Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
rah_flat (template file extensions)
I’m still kind of new to rah_flat, but it seems to output templates with extension .txp. Is there a reason for that, instead of having something more useful like .textile? Every time I have to edit a template, TextMate doesn’t like it, and understandably so. If the extension was .textile, TextMate would immediately throw the appropriate bundle on it and that would be nice. Can that be changed? Even better, I suppose, would be a preference for the plugin that allows you to choose what extension you want to use, so that one could more easily edit in .md, .txt, .textile, or whatever else.
Offline
Re: rah_flat (template file extensions)
Can’t you associate filenames to modes in TextMate? That’s what I do in Panic Coda to associate .txp
with the Textpattern Syntax Mode within.
For our Textpattern 4.7 core theme versions the filename is still up for debate. It would probably stay as .txp
or just use .html
. Since the template files are not Textile, I doubt that is right filename to use.
Offline
Re: rah_flat (template file extensions)
philwareham wrote #297506:
Can’t you associate filenames to modes in TextMate?
If I can, I’m not sure how. I can assign an unknown type to .textile, which will effect any other unknown type too, but I don’t see anywhere to make a special association from .txp alone. But I could be missing it.
Offline
Re: rah_flat (template file extensions)
philwareham wrote #297506:
Can’t you associate filenames to modes in TextMate?
Just figured that out now. They call it “grammars” in TM. Ha! Thanks for the tip.
Offline
Re: rah_flat (template file extensions)
tip: sublime text works awesomely with textpattern rah_flat projects. It’ll let you have a window with a collection of files that you can save as a workspace, and you can even set up .txp as an .html equivalent which allows automatic closing of textpattern tags.
Love me some sublime text.
Offline
Re: rah_flat (template file extensions)
I use a lot of forms… which can get confusing at times.
I realized the other day that if rah_flat were to look recursively under the forms directory and not just one level deep we would have a killer organizational tool.
Everything would be WAY, WAY easier to find.
Unfortunately Jukka is MIA, and it exceeds my skillset to do so. Anyone else wanna try?
-D
Offline
Re: rah_flat (template file extensions)
mrdale wrote #297541:
I use a lot of forms… which can get confusing at times.
I realized the other day that if rah_flat were to look recursively under the forms directory and not just one level deep we would have a killer organizational tool.
Can you give an example of how you would organise things, or how the resulting forms should be named based on the folders? I generally try and use prefixes to make forms more findable.
Was just wondering if you could achieve this another way, i.e. work in parallel folder on templates and have a watch script create the templates in the naming scheme you want for rah_flat. Ideas here and here.
TXP Builders – finely-crafted code, design and txp
Offline
Re: rah_flat (template file extensions)
Maybe you have…
- 6 forms that deal with user profile management
- 4 forms that deal with image galleries
- 3 Page structure forms
I’d like to be able to simply have the following directories under “forms”
- forms
- user
- user_login
- user_password_reset
- etc…
- galleries
- hero_large
- hero_small
- etc…
- page
- page_header
- page_footer
- etc…
- user
Simply making rah_flat to look at the contents of subdirectories as well would be an elegant way to arrive at simple but effective organization… I can’t imagine it would be a difficult mod to rah_flat.
For extra points you could have it create custom form types
Offline
Re: rah_flat (template file extensions)
mrdale wrote #297541:
I realized the other day that if rah_flat were to look recursively under the forms directory and not just one level deep we would have a killer organizational tool.
+1000, I had exactly the same request months ago
and Yes, with grunt you can organize files into subfolders and copy to another folder at the same level. but it’s turning a routine with a watcher and systematically copy all template files from one folder to another for every small change on a file. Briefly, the simplest would still be an update of the plugin… But this plugin is orphan.
I hope that core solution with the new core template system (4.7… 4.8 ?) will allow a free organization of template files in subfolders.
Offline
Re: rah_flat (template file extensions)
sacripant wrote #297560:
I hope that core solution with the new core template system (4.7… 4.8 ?) will allow a free organization of template files in subfolders.
I think that’s where the solution really needs developed, for example. First to provide custom labeling and organization in the Forms panel itself, and then for a plugin (rah_flat or any similar one that comes along) to mimic that structure in a flat-file tree as sub-folders. Likewise, to be able to edit the flat tree structure, and have Txp “suck up” that structure change in the Forms panel via the plugin, but that might be asking too much.
Offline
Re: rah_flat (template file extensions)
Yep, custom form types would be ideal, but to be frank, since I started using rah_flat I almost never visit anything under Presentation in the UI… It’s just way way way slower.
Consequently I’d prefer a simple mod to rah_flat. Anyone with a great big brain wanna help?
Offline
Re: rah_flat (template file extensions)
So I’m still looking into making rah_flat recursive, ie look into subfolders for imports to keep largeprojects more organized.
It seems that rah flat creates a class Rah_Flat_TemplateIterator
that extends public class DirectoryInterator
info»
There is a similar public class called RecursiveDirectoryIterator
info»
I did try simply replacing the class DirectoryInterator
with RecursiveDirectoryInterator
to no avail.
Anyone with a brain feel like making this sucker recursive?
for extra points have it avoid a foldder called “disabled”.
Offline