Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS

[eluser]Yorick Peterse[/eluser]
[quote author="Phil Sturgeon" date="1248209140"]Ahh, well thats alright then. We need a way to return it as a string so it can be loaded within HelpfulParser, and therefore used in pages.[/quote]

Sure thing, I'll start working on that later tonight (or tomorrow morning) Smile

[eluser]ray73864[/eluser]
I suppose once i see a good example i will be fine. I see the widget as getting information from a database table, for instance i have a contacts table which lists all the contacts, i might have a widget to grab a random set of them everytime the page is loaded.

I just can't see how to do that yet because there isn't an example, will wait and see. Smile

[eluser]Edward.H[/eluser]
I'd never heard this CMS before,I'll try it,thanks

[eluser]ray73864[/eluser]
ooooh, the doco has disappeared for the widget library Smile

[eluser]Yorick Peterse[/eluser]
[quote author="ray73864" date="1248501275"]ooooh, the doco has disappeared for the widget library Smile[/quote]

I removed it since it was outdated. Don't worry though, it will be added to the PyroCMS wiki instead Smile

[eluser]ray73864[/eluser]
Hi Yorick,

I downloaded 0.9.6 and followed how you did the 2 other widgets, however my new widget doesn't seem to be appearing.

widget.json looks like this:

Code:
{
    "name"        :    "Opening Hours",
    "author"        :    "Ray Herring",
    "description"    :    "This widget displays the opening hours for the pharmacy",
    "license"        :    "MIT License"
}

opening_hours.php:

Code:
<?php
/*
* @name     Recent News Widget
* @author     Yorick Peterse
* @link    http://www.yorickpeterse.com/
* @package PyroCMS
* @license MIT License
*
* This widget displays the opening hours for the pharmacy
*/
class Opening_Hours extends Widgets {
    
    
    // Run function
    function run()
    {
        $this->CI->load->module_model('pages','pages_m');
        print_r($this->CI->pages_m->page());
    }
    
    
    // Install function (executed when the user installs the widget)
    function install()
    {
        $name = 'opening_hours';
        $body = '';
        $this->install_widget($name,$body);
    }
    
    
    // Uninstall function (executed when the user uninstalls the widget)
    function uninstall()
    {
        $name = 'opening_hours';
        $this->uninstall_widget($name);
    }
}
?>

both files live in the directory 'widgets/opening_hours'

[eluser]Phil Sturgeon[/eluser]
Good news and bad news.

Good news
PyroCMS v0.9.6 is out which fixes several bugs and brings full support for Spanish language. We have cleaned up the comments admin and tidied some less-used navigation items to be children of the Settings link.

Bad news (for us)
Yorick is away for two weeks so the work on widgets is slightly on pause. I may dabble a little but I might end up leaving the interface for him to develop. I REALLY want to finish off some utilities like Cache management, etc first before we get to v1.0.

Just to let you guys know, we have Dutch nearly finished and Chinese language files too. We just need to work out how to sort out Chinese character replacement for slugs and we are good to go!

[eluser]ray73864[/eluser]
I worked it out to a certain extent. Although this is looking to be more complicated than a widgets library really needs to be.

First you have to create a folder in the 'widgets' directory and make sure it has a 'widget.json' file in it, then you need to do up your views and the main function object for that widget.

Secondly you need to make sure that your layout has an 'area.json' file in it and includes code to load widgets into that area.

Lastly, you need a widgets table in your database, which is all good and everything except the installer doesn't come with the necessary sql code for creating the table. Sad

[eluser]pysco68[/eluser]
Good morning,

I just took a look at the CMS, and since the last time there's realy great improvement!
I just wanted to offer my German and French knowledges to this great project,
hoping it could be usefull;

Greetings from France

[eluser]Phil Sturgeon[/eluser]
Language packs are of course welcome. French and German would be brilliant additions to the codebase.

If you know Git and would be able to check out the code that really would be the easiest method. It also means you can add translations on an ongoing basis which if you were up for it would be ideal.

The main problem at the moment is people add language packs then when I want to work on a new feature I have to make it all english again >.<




Theme © iAndrew 2016 - Forum software by © MyBB