Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-03-08 17:27:51

etc
Developer
Registered: 2010-11-11
Posts: 3,267
Website

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 and error_default pages, and we get rid of archive.
  • Some tags are still a bit rigid. Say, <txp:recent_articles /> does not accept form 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.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#2 2019-03-08 18:08:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,749
Website

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

#3 2019-03-08 19:15:07

etc
Developer
Registered: 2010-11-11
Posts: 3,267
Website

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 :-)


etc_[ query | search | pagination | date | tree | cache ]

Offline

#4 2019-03-09 15:02:19

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,284
Website

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 | Simplr theme | Wait Me a maintenance theme

Offline

#5 2019-03-09 16:09:56

etc
Developer
Registered: 2010-11-11
Posts: 3,267
Website

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.


etc_[ query | search | pagination | date | tree | cache ]

Offline

Board footer

Powered by FluxBB