Integrating Agile Toolkit with WordPress

Tuesday, October 25th, 2011|Beginner tips, Version 4|by Romans

The question I get asked a lot is how to integrate Agile Toolkit with other frameworks.

One of the best qualities of Agile Toolkit is that it can be very nibble when you want to use it to fill the gap. So let’s scrap the whole page routing mechanics and simply create a SINGLE PHP file which would work on it’s own. For this, you will need to have most up-to-date Agile Toolkit (4.1.3).

Download “Agile Toolkit” and un-pack in the temporary directory. Copy folder “atk4″ into your wordpress directory.

Next open file test.php inside your wordpress and type the following:

[php]
<?php
include ‘atk4/loader.php’;
$api=new ApiWeb(‘sample_project’);
$api->add(‘jUI’);
$api->add(‘H1′)->set(‘Subscribe to Newsletter’);
$form=$api->add(‘Form’);
$form->addField(‘line’,'email’);
$form->addSubmit(‘ok’);
if($form->isSubmitted()){
$em=$form->get(‘email’);
$form->js()->univ()->alert(‘Thank you for subscribing, ‘.$em)->execute();
}
$api->execute();
[/php]

If you open this file in your browser, you’ll see a form with a field. You can now refer to samples on agiletoolkit.org site to customize or even create your own theme, but pretty much any code should work for you.

1 Comment

Nick
Posted September 20, 20125:28 am

When you say: “Copy folder “atk4″ into your wordpress directory.” Do you mean the theme directory?

Given that you need to decorate a template page with

I’m unclear of how this works.