We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE

Development and Programming

UKFreelancer's avatar
UKFreelancer
49 posts
14 years ago
UKFreelancer's avatar UKFreelancer

How are you supposed to do any development?

I’m using EE’s example for adding a Template Group, and all I get is a blank page.

No error messages?

       
UKFreelancer's avatar
UKFreelancer
49 posts
14 years ago
UKFreelancer's avatar UKFreelancer

Right I’ve fixed that issue.

Hadn’t Initialised the Class.

Here’s a new one:

How do I create a Template Group that is a Duplicate of another? As the EE documentation doesn’t help!

    'group_name'        => $groupname,
    'group_order'       => 2,
    'is_site_default'   => 'n',

‘duplicate_group’ => 16, ‘site_id’ => 1

That produce a Database Error.

Anyone know the answer?

       
UKFreelancer's avatar
UKFreelancer
49 posts
14 years ago
UKFreelancer's avatar UKFreelancer

Here’s the error generated by the above code:

Error Number: 1052

Column ‘group_id’ in where clause is ambiguous

SELECT template_name, template_data, template_type, template_notes, cache, refresh, no_auth_bounce, allow_php, php_parse_location, template_id, template_name, group_name FROM (exp_templates) JOIN exp_template_groups ON exp_templates.group_id = exp_template_groups.group_id WHERE exp_templates.site_id = 1 AND group_id = 16 ORDER BY group_name, template_name

Filename: C:\wamp\www\system\codeigniter\system\database\DB_driver.php

       
UKFreelancer's avatar
UKFreelancer
49 posts
14 years ago
UKFreelancer's avatar UKFreelancer

The documentation says this:

$this->EE->api_template_structure->create_template_group((array) $data, (int) $duplicate) Example Usage:

$data = array( ‘group_name’ => ‘home’, ‘group_order’ => 2, ‘is_site_default’ => ‘n’, ‘site_id’ => 1 );

$this->EE->api_template_structure->create_template_group($data, 1);

Is the ID of the Duplicate supposed to be in the $data, or the $duplicate?

Because neither works!

       
UKFreelancer's avatar
UKFreelancer
49 posts
14 years ago
UKFreelancer's avatar UKFreelancer

Anyone?

Or does this need to be raised as a BUG?

       
Rob Allen's avatar
Rob Allen
3,114 posts
14 years ago
Rob Allen's avatar Rob Allen

Not sure what you’re trying to do but you can duplicate a template group from the Templates manager in the Control panel…?

       
UKFreelancer's avatar
UKFreelancer
49 posts
14 years ago
UKFreelancer's avatar UKFreelancer

Thanks for the reply.

I already know that.

It needs to be done in code, hence using the API.

This is what I am doing:

Admin creates an Entry in the Clients Channel, my code then creates a MemberGroup, a TemplateGroup and a Directory on the webserver for uploads.

It is all working with the exception that it doesn’t duplicate the template group, it just creates a new one with an empty Index template.

I’m trying to follow the API Documentation for duplicating a template group using the API, but it either doesn’t work or produces the SQL Error (see previous post).

UKFreelancer.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.