Search

I wondering if I could have some pointers...

I like the idea of Symphony and I would like to combine it to an API from Affiliate Window. Would this be done via developing an extension?

If so is there developer docs on developing extensions?

Here is a model version from Affiliate Window themselves I think they use smarty.

http://www.shopwindow.com/

Any help guidance would be really helpful.

Thanks

There is presently no documentation on developing an extension for Symphony but you'll find that it is actually quite straight forward. I would recommend downloading one of the extensions by another developer and having a look at how that works.

As a bare minimum an extension will need an extension driver called extension.driver.php This lives in the root folder of your extension and is used to tell symphony about your extension, run an install/uninstall actions and subscribe to delegates elsewhere in symphony.

Your extension driver will look a little like this:

class extension_slideshowpro extends Extension
{
#code here...
}

inside this class definition you will need at most an about() function. This looks like this:

public function about()
    {
        return array(
            'name'            => 'Slideshow Pro',
            'version'        => '0.1',
            'release-date'    => '2009-02-04',
            'author' => array(
                'name'        => 'Matt Shaw',
                'website'    => 'http://mattshaw.mp',
                'email'        => 'matt@mattshaw.mp')
        );
    }

If you wish to add a link to the navigation bar in Symphony, this can be achieved like this:

public function fetchNavigation(){ 
            return array(
                array(
                    'location' => 600,
                    'name' => 'Slide Show Pro',
                    'children' => array(
                        array(
                            'name' => 'Dashboard',
                            'link' => '/images/'                            
                        )
)
);
}

To build admin interfaces in symphony you will require a folder called content in the root of your extension. Pages under this folder will be bnamed content.yourPageName.php content pages generally extend the default Symphony AdministrationPage class; your class definition would therefore look something like :

class contentExtensionSlideshowproGalleries extends AdministrationPage

individual views inside this class are then defined as function, i.e your index page would be defind thusly:

function __viewIndex()
{
#code goes here...
}

Symphony needs to know what type of page you are defining; this is usually 'table' (such as the page listing) or 'form' (such as the type of page you get when configuring a page or editing an article). The code to do this looks like this:

$this->setPageType('table');

You can also give your page a title:

$this->setTitle("Slideshow Pro");

Now you can move onto the fun of actually building up your page elements. If you have ever done any DOM scripting then the techniques below should make sense to you. What I will do is create a div element and add it to the page.

$div = new XMLElement('div');
$div->setAttribute('class', 'info');
$this->Form->appendChild($div);

This creates a div element, adds an attribute to it with a name of class and a value of info and finally adds it to the page.

This really is a super quick overview of the basics but hopefully it should get you started. If you get stuck then there are plenty of us on the forum so don't be afraid to come back and ask some more and like I said above one the best ways is to look at how others have done it!

Although they are not the same, you can still find documentation about Campfire Service (basically Symphony 1.7 extensions) at http://archive.overture21.com/wiki/campfire/campfire-api which might be useful.

looking through some extensions, and not knowing php that well, what is this piece of code supposed to mean: Widget::? I've seen this in a few extensions, but can't really seem to find anything about this online.

wdtan, it's a static class used to render HTML widgets (form fields, tables, etc...). Look into symphony/lib/toolkit/class.widget.php to see what it has to offer :).

Whoever took the time to edit my post above deserves my thanks, so thankyou! I am more than happy to post more info as I learn more about the available APIs.

thanks, ahwayackchih. anything that looks similar to Widget::, will most likely be in a class file? I saw a few others, but forget what they are exactly.

I'm back with some more questions.

SW Client is powered by a number of SOAP API calls, such as $oClient->call('getXXXXX', $aParams). Each getXXXXX is web service function if you like and $aParams being parameter array.

Am I correct in thinking that each getXXXXX functionality would be best developed as individual data-sources or would I define one data-source class and each getXXXXX as function in the single data-source class?

Thanks again

i would imagine if you got all the SOAP calls at once, then you can spit it all out into one data source.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details