Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Future Imperfect - a HTML5 UP theme for Textpattern
I wanted to test existing themes adaptability to Textpattern. As example, I have taken HTML5 UP Future Imperfect theme.
It turns out that the modifications are quite straightforward, though I have not tried to tweak it to perfection. It has taken only few hours of work, but has allowed me to come to some conclusions:
- Multiple page templates are slowing the work down, since you have to adapt all of them. I would recommend that our default setup contains only
default
anderror_default
pages, and we get rid ofarchive
. - Some tags are still a bit rigid. Say,
<txp:recent_articles />
does not acceptform
attribute. - Some attributes (
class
,label
etc) default values often need to be unset. - Global attributes and
<txp:evaluate />
are quite handy.
You can download the result here. Please feel free to suggest any modifications, UX is not my cup of tee.
Offline
Re: Future Imperfect - a HTML5 UP theme for Textpattern
Nice! I’ve done a similar thing with HTML5 Up themes in the past and saved them as a theme that I can reuse. From what I recall though, the one I chose had two sections to it; one for the front page and one for regular content so the setup of two sections was actually beneficial.
Consolidating everything required into one page template is tempting, but it does complicate things as we need more conditionals on the page, which makes it more difficult to understand for newbies. Since one of the goals of the base template is as a teaching aid (hence the comments Phil put in) the ability to showcase multiple pages is kind of useful.
I agree that doing things once for each page is annoying but it’s something I go through anyway by farming stuff out to forms. My base templates generally become a top-level structure document that holds the DTD, html, and body tags and a bit of container markup inside. Then in each block, I call a Form such as html-head
, page-header
, nav
, page-footer
, etc. Each of those forms may call sub-forms (e.g. html-head might have component Forms such as html-css
, html-title
, and html-meta
) and those forms usually contain the conditional logic that determines if anything is handled differently on the front page vs any other page.
That sometimes means I only need one main Page template but usually the overall structure of the home page is slightly different to regular content and also handles search, and category/author/tag lists so to avoid cluttering all other pages up, I’ll employ two.
The good news is that once I’ve converted the front page to use the cascading Forms, the other page for regular content is pretty easy to convert as it’s mostly the same, just with a few different container elements or sometimes different form
attributes in <txp:article>
tags if the content is to display differently.
Not saying a single Page template is a good or a bad thing, as it might be nice to offer both options, or at least put such things on the Themes site when it comes online. Just that I find most sites I construct have two. When I’ve finalised my starter theme with the various components I mentioned above separated out, I might publish it. I’ve used it a few times in the last few weeks and it speeds things up no end. I’d also like to Texpatternise some of the HTML5 Up themes as you’ve done (I think the licence permits that) and make those available for people on the Themes site.
Totally agree about the rigidity of some tags. And if we can make tag defaults more logical or consistent or less necessary to override, then that’s all good. Fix at will! :)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Future Imperfect - a HTML5 UP theme for Textpattern
Bloke wrote #316919:
Nice! I’ve done a similar thing with HTML5 Up themes in the past and saved them as a theme that I can reuse. From what I recall though, the one I chose had two sections to it; one for the front page and one for regular content so the setup of two sections was actually beneficial.
They actually have one template for lists and another one for single articles, but these would rather be forms in txp case.
I agree that doing things once for each page is annoying but it’s something I go through anyway by farming stuff out to forms.
That’s a perfect approach, but since form=db query, I try to include all common code directly in pages. Whence the trouble with multiple pages :-)
I’d also like to Texpatternise some of the HTML5 Up themes as you’ve done (I think the licence permits that) and make those available for people on the Themes site.
I have kept all author mentions, so it should be ok.
Totally agree about the rigidity of some tags. And if we can make tag defaults more logical or consistent or less necessary to override, then that’s all good. Fix at will! :)
Will fix :-)
Offline
Re: Future Imperfect - a HTML5 UP theme for Textpattern
Hi Oleg ;)
Cool.
Just a comment. For your canonical URL you use:
<link rel="canonical" href="<txp:if_individual_article><txp:permlink /><txp:else /><txp:page_url context="s, c, author" /></txp:if_individual_article>">
Which display the author login name. I don’t know if this is what you want but maybe you could change as this:
<link rel="canonical" href="<txp:if_individual_article><txp:permlink /><txp:else /><txp:if_author><txp:author format="url" /><txp:else /><txp:page_url context="s, c" /></txp:if_author></txp:if_individual_article>">
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Future Imperfect - a HTML5 UP theme for Textpattern
Hmm, thanks Patrick. That’s actually a <txp:page_url />
bug, will patch both in core and theme.
Offline