Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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.
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,310
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,310
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
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
I’m looking at mem_templates now – I really like it because it includes plugins & sections – still testing though
Offline
#47 2013-01-15 22:54:01
- rcpinheiro
- Member
- Registered: 2013-01-12
- Posts: 11
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
tye wrote:
I’m looking at mem_templates now – I really like it because it includes plugins & sections – still testing though
mem_templates has the same problem with the “is_default”.
hcg_templates works :)
Last edited by rcpinheiro (2013-01-15 22:57:25)
Offline
Re: [plugin] [ORPHAN] cxc_templates : front-end template management
You are right – I posted a txp 4.5 fix for mem_templates here a few days ago – it seems to be working fine for me
Offline