These are chat archives for fansoro/fansoro

8th
Dec 2015
Sergey Romanenko
@Awilum
Dec 08 2015 08:32

@/all 45 Plugins already available for Morfy! :sparkles: :rocket:
https://github.com/morfy-cms/morfy-plugins-catalog
xxwebplus
@xxwebplus
Dec 08 2015 12:33
cool remainder 5 for the goal :)
Moncho Varela
@nakome
Dec 08 2015 13:55
@Awilum I use php php-cs-fixer fix C:\wamp\www\plugins It's ok?
to fix all files of folder
Host de experiencia del shell de Windows.jpg
Sergey Romanenko
@Awilum
Dec 08 2015 14:03
yes, it says that every this file must be fixed
its ok @nakome
Moncho Varela
@nakome
Dec 08 2015 14:04
@Awilum I fix all plugins and admin panel
Sergey Romanenko
@Awilum
Dec 08 2015 14:04
but check is everything is works fine after fixer
Moncho Varela
@nakome
Dec 08 2015 14:04
ok
Moncho Varela
@nakome
Dec 08 2015 14:12
I think all it's ok
Sergey Romanenko
@Awilum
Dec 08 2015 14:13
@nakome good!
Moncho Varela
@nakome
Dec 08 2015 14:21
@Awilum Yesterday i make a poll plugin simple Demo But if not change options on system.yaml not work, the plugin use cookie and json data
Host de experiencia del shell de Windows.jpg
Sergey Romanenko
@Awilum
Dec 08 2015 14:23
@nakome its a shortcode on the page ?

@nakome try to flush pages cache after your actions and you want to see FRESH data on your page from your POLL plugin

See how its done for Blocks https://github.com/morfy-cms/morfy/blob/dev/morfy/Blocks.php#L53

Moncho Varela
@nakome
Dec 08 2015 14:25
yes I think the problem also is this
ok
Sergey Romanenko
@Awilum
Dec 08 2015 14:25
To flush page cache on fly
Config::set('system.pages.flush_cache', true);
Moncho Varela
@nakome
Dec 08 2015 14:30
@Awilum ok if write this out of shortcode work
inside shortcode not work
Sergey Romanenko
@Awilum
Dec 08 2015 14:36
@nakome can you upload your code ?
Moncho Varela
@nakome
Dec 08 2015 14:42
@Awilum ok one momment
Sergey Romanenko
@Awilum
Dec 08 2015 14:49
@nakome okey, I will check it today, a little bit later.
Moncho Varela
@nakome
Dec 08 2015 14:49
@Awilum :+1:
Moncho Varela
@nakome
Dec 08 2015 15:09
Sorry now not work the plugin
Sergey Romanenko
@Awilum
Dec 08 2015 15:10
issue in Plugin code ?
Moncho Varela
@nakome
Dec 08 2015 15:14
Now its ok i upload
Sergey Romanenko
@Awilum
Dec 08 2015 15:14
okey will check
Moncho Varela
@nakome
Dec 08 2015 15:32
I update demo with progress bar and more questions demo
Sergey Romanenko
@Awilum
Dec 08 2015 16:22

@nakome

I have checked it.
The reason why this issue is reproduced is because the page content where shortcode is placed with logic is cached and that's why you may not see actual result after form submit. if there doesn't exists some others issues with logic inside your plugin. but adding this

Config::set('system.pages.flush_cache', true);

or

Action::add('plugins_loaded', function () {
    Config::set('system.pages.flush_cache', true);
});

must resolved this issue. because its says to Morfy Pages that page is updated and new unique cache must be created for it. But in your plugin for some reason its not works. Need more time on investigate of this issue.

My recomendation: dont use shortcode for this plugin. Create a Tempalte function for templates. for e.g. https://github.com/morfy-cms/morfy-plugin-contact/blob/master/contact.php and template usage is

{Contact::form()}
  • OOP Style

or procedure style

function poll() {

}

and usage in template

{poll()}
Moncho Varela
@nakome
Dec 08 2015 17:12
@Awilum ok thx
Sergey Romanenko
@Awilum
Dec 08 2015 17:33

@/all Morfy 2.0.2 Release! http://morfy.org/blog/morfy-2.0.2 :rocket:
Sergey Romanenko
@Awilum
Dec 08 2015 18:15

@/all
Default Theme in Morfy 2.0.2 use BOWER http://bower.io
And if your are using composer or github clone to install Morfy
then You also need to install vendors for Default Theme by running in console

bower install

from default theme directory

Also, in Morfy 2.0.2 you may access current page template and set your variables if needed
Example:
Action::add('before_page_rendered', function() {
    $template = Pages::getCurrentTemplate();
    $template->assign('var', 'value');
});
Moncho Varela
@nakome
Dec 08 2015 21:03
@Awilum :+1: