Posted by oe.elvik on October 20, 2011 at 1:50pm
I've been searching for a module that would help generate a theme out of a static html file.
So fare all i found was the module Theme Generator. But in addition to being abandoned its not quite what I'm looking for.
I think the module would work like this:
- You select a static html file as the basis for the theme. Give the theme a name and press submit.
- The module now shows a preview like the one found under Structure -> Blocks -> Demonstrate block regions (Bartik) but instead of regions being highlighted the module highlights all div, td, header, footer, section, .... html tags that the user may select as container for regions and template vars.
- The user clicks on a desired tag visible in the preview
- A dialog for defining this tag as container for a region or variable apears.
- User selects region or variable and click submit.
- When user is done adding regions and template variables, the theme.info, html.tpl.php and page.tpl.php gets generated.
Some additional features:
- Abillity to select a part of the static template to use as template for blocks, nodes, ++. Then follow from point 2 above to generate individual template files.
- Ability to recreate all theme files based on an altered version of the static html file
So what to do:
- Does this already exist?
- Should I start development of a new module.
- Or should i rather contribute to some other module
- Or last, is it a total waste of time. Developing this module.
Comments
I like the idea, but I have a
I like the idea, but I have a feeling it would end up being a lot less straight forward than that for any type of 'complicated' layout. Take for example most layouts are just divs with a bunch of CSS, If the CSS is dictating positions or if there's any javascript altering positions they would be unavailable to the region selector. It would still work, but the preview wouldn't be very accurate. Obviously there's ways to get around that, but as you do the process would continually get less user friendly. Upload a zip file of the files instead? Perhaps point the module at a folder to pull from? Pretty clunky solutions.
This idea would work well with simple layouts, but at that point I'd have to question if it'd just be quicker and easier to write the tpls and info file yourself.
I don't have any answers to your questions, sorry. But I do like the idea if it can be pulled off well. It would let less technical designers make themes out of their static html files.
Yes the issue with external
Yes the issue with external css and js files has to be addressed.
Hmmm...
You could probably accomplish this using the following process:
You could even optionally generate exportable Panels output (not a personal fan, but it is popular) for the page's content layout, giving finer-grained control for that space.
I do agree with @skelooth though that for simple layouts, it would probably be way easier to create your own theme from scratch (a great guide here by Bob @ Mustardseed Media), but I can also see value in a tool like this on hosted solutions where you might want to control the custom themes.
It'd also be a great tool to point at an existing site for a migration to generate a similar layout - or at least give a good starting point.
Yes QueryPath looks like a
Yes QueryPath looks like a must for a module like this.
Thank you fore the input.