Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Hi there,
I really like cxc_templates, but is there a way to enforce certain site-wide preferences (such as date format, url style, comments and such)? Also some plugin settings (for example smd_bio, which fields are set up) would be nice to include into a theme.
Since the documentation did not help me so much maybe someone here could help me out. How can I include txp core preferences and plugin-specific preferences to a theme that can be imported using cxc_templates?
Yoko for Textpattern – A free blog theme • Minimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
cXc wrote:
Nobody complained about the last couple releases so I went ahead and added language string support (until I can figure out textpacks) and moved the release to public beta. The cxc_templates v0.1.0 plugin is now available at Google Code and I’ve updated the first post of this thread :)
Is the language string support also applicable to themes? So that I could create a theme that in installation 1 would be in english versus installation 2 it (i.e. the exact same zip file that a user imported) would result in a french localized theme? That would be terrific!
Yoko for Textpattern – A free blog theme • Minimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Love it.
Would be wonderful to have a ‘export articles’ just to move websites from local to remote and back, and some way to automatically install a page/form/article whenever it’s changed.
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
OK – I just started to use this to import the yoko theme – and I got it to work great :)
Then I thought cool, I’ll import another theme – so tried TXP Tumbog – but this didn’t seem to import correctly at all (would the version of TXP have an effect on using this, I just noticed that TXP Tumbog was built for 4.3). Just to check – I uploaded the template into the /tpl folder selected it from the dropdown, then press import – I did nothing else – is that right? I didn’t import, just a message about preimport-data being deleted.
So I tried the translucence template, which didn’t work either – it mentioned that it was all imported OK, and the yoko theme exported (so TXP Tumblog can’t have worked) – but when I view site – I get this error (front of site and admin):
Fatal error: Cannot redeclare theme_variables_tip() (previously declared in /Applications/MAMP/htdocs/txp-441/textpattern/lib/txplib_misc.php(653) : eval()'d code:66) in /Applications/MAMP/htdocs/txp-441/textpattern/lib/txplib_misc.php(653) : eval()'d code on line 66
I know both themes have variables… is this a possible bug? Or just something I have done incorrectly at some stage in the import – like clear all previous settings?
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
The thing is, that you cannot have the plugin yoko_theme_variables active at the same time as any other “flavor” of adi_variables. So if the tumble blog theme also uses a variables plugin, please deactivate the other plugins before starting the import using cxc_templates.
Yoko for Textpattern – A free blog theme • Minimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Thanks stephan – that was the problem :)
Loving the template btw :)
One more thing using cxc_templates though – if you delete a template, it doesn’t seem to remove the old template?
Is that correct or again am I doing something wrong?
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Yeah, you cannot “delete” a theme if you mean get rid of all pages, forms, styles, and plugins. You can only get rid of the folder in the tpl folder.
And thanks for liking the templates :-)
Yoko for Textpattern – A free blog theme • Minimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Great plugin!
After exporting I couldn’t edit / delete it via ftp.
I don’t know if it’s only my provider misconfiguration – anyway I added chmod at end of export function.
Now I can edit theme with Komodo and then import, and it’s way more convenient than before. Thanks.
Fac Si Facis
Offline
#39 2013-01-14 20:26:42
- rcpinheiro
- Member
- Registered: 2013-01-12
- Posts: 11
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Hi!
I have a clean installation of the latest TXP and cxc_templates.
I imported a template Zip file and at the end I got an error:
Internal error: unknown column 'is_default' in field list
After that error, there is a “Successful installation” message but the template doesn’t appear on the site and there is no template cover in the admin panel (“No Preview Image Available”)
After some digging, it seems cxc_templates assumes I have a “is_default” field in the Section database. I think that field only appears after installing the MLP plugin (which I don’t need):
Any ideas on how to get rid of the problem?
Thanks in advance!
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
rcpinheiro wrote:
After some digging, it seems cxc_templates assumes I have a “is_default” field in the Section database.
That field was removed from the txp_section table in Textpattern 4.5.0. Your best bet is to hunt through the plugin code and eradicate any reference to is_default.
If your PHP is as good as my knitting, you may have to enlist the help of someone to do that for you. I’ve just whizzed through the code and found all references so here’s my (untested) take on it:
Line 516 should read:
'fields' => 'name, page, css, in_rss, on_frontpage, searchable, title',
Line 519 should be:
'sql' => '`page` = "%s", `css` = "%s", `in_rss` = "%d", `on_frontpage` = "%d", `searchable` = "%d", `title` = "%s"',
In function writeSectionFiles (at line 682) remove line 687 that reads:
$is_default = "is_default=0\n";
and remove line 695:
fwrite($f,$is_default);
and remove line 704:
$is_default = "is_default=".$row['is_default']."\n";
and remove line 712:
fwrite($f,$is_default);
Alter line 866 (which will be line 862 if you’ve removed the previous 4 lines!) to:
$rs = safe_row('page, css, in_rss, on_frontpage, searchable, title', $config['table'], 'name="'.$templateName.'"');
Remove line 976 (aka 972 if above four lines have been removed):
'is_default' => 0,
and finally alter line 992 (aka 988) to:
$sectionLine = sprintf($sql, $sectionValues['page'], $sectionValues['css'], $sectionValues['in_rss'], $sectionValues['on_frontpage'], $sectionValues['searchable'], $sectionValues['title']);
As I say, totally untested, but if you hack all that out the plugin should run. In the absence of cxc, someone will probably adopt this one at some point and do a proper job of the above.
Hope that helps.
Last edited by Bloke (2013-01-14 20:59:09)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#41 2013-01-14 21:50:21
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,320
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Bloke wrote:
In the absence of cxc, someone will probably adopt this one at some point […]
Uuhh, no posting by Doc/cxc since almost two years. That’s probably reason enough to see the plugin as a member of the Orphaned family. I’ll beam it over there.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
I fiddled around and this might be helpful:
https://github.com/perlmonkey/txp-cxc-templates
I briefly tested it to be working – just copy and paste this as your cxc_templates plugin: cxc_templates_v0.4.5.txt
Yoko for Textpattern – A free blog theme • Minimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often
Offline
#43 2013-01-15 11:26:47
- rcpinheiro
- Member
- Registered: 2013-01-12
- Posts: 11
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
Thanks stephan!
The error just went away with your version but still no template preview available and, most important, didn’t change the site theme.
Oh well, back to the old ways copying files to and fro, I never thought installing themes on TXP was such a hassle…
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
I recomment looking at hcg_templates or mem_templates which I can’t seem to find a thread for.
Last edited by MattD (2013-01-15 17:20:10)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
#45 2013-01-15 21:54:46
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,320
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
MattD wrote:
mem_templates which I can’t seem to find a thread for.
As far as I understood cxc’s plugin introduction mem_template has never been publicly released. Yet it’s still available at Michael’s bitbucket.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline