Posts by SAB

    The current environment for testing meets the requirements. But installing the same release file (a zip) results in success via the upload method but will fail via marketplace.

    I noticed, that I can't install the SAB Form v1.0.1 from the marketplace on a production environement, it just says:

    Code
    1. Loading composer repositories with package information
    2. Updating dependencies
    3. Your requirements could not be resolved to an installable set of packages.

    Installing with debug mode enabled, does not give me more intel.


    The weird thing is that, if I install the same zip which i released at the marketplace via upload at System > Extensions there is no error (as expected, running the required PHP v7.1 and Pagekit 1.0.15). I have no clue how to approach this problem.


    Any hints?

    PHP
    1. 'events' => [
    2. // captcha bug fix (occurs in Pagekit v1.0.15)
    3. 'request' => [function ($event, $request) use ($app) {
    4. if ($request->attributes->has('_captcha_verify') && 0 < count(Arr::filter($app->config('system/captcha')->toArray(), function ($val) { return !$val; }))) {
    5. $request->attributes->set('_captcha_verify', false);
    6. }
    7. }, -90],
    8. ]

    That piece of cod should fix the issue related to the captcha. Paste it e.g. to the blog index.php, actually you can paste it in an arbitrary index.php. Or just instaling SAB Form should also fix the problem.

    What exactly is a '5 stars question sheet'? Is that five starts to click on to star something? That's is achieved very easy with vue js (also v1).


    For my form extension, it could be possible to add "custom" inputs via vue components. In vue js v2 i could directly use v-model on components, in v1 that's not possible, but i think will no problem since such customs i have to hardcode anyway ...

    Hey


    How can I require in a extension a version of Pagekit & PHP? I need at least Pagekit v1.0.15 & PHP v7.1, otherwise the extension & a dependencies will not work. Is there also a way to show a message considering the requirements.


    Thanks,

    SAB

    PHP
    1. <a href="<?= $node->getUrl() ?>" <?= $node->type == 'link' ? 'target="_blank"' : ''?> >
    2.     <?= $node->title ?> <?= $node->type ?> <?-- <- for debugging ?>
    3. </a>

    Your last statement is not clear to me - it always adds the target attribute?

    You can check the node type with $node->type == 'link' as the type property of the Node object is public. You can also check for any other type like this. Node types are determined via the index.php of all modules. Pagekit has two types: 'page' and 'link', if blog is installed also 'blog'.


    Custom types can be added by extensions: https://pagekit.com/docs/devel…ister-nodes-for-site-tree


    Types get registered during runtime:

    Fosphatic Duke the success and error attributes are just replace with v-show="status == 2" & v-show="status == 3". you can also just skip this & use directly vue js syntax for hiding/showing on different from status.

    Mercator i only wrapped all inputs in a fieldset to disabled them all at once. propably the grid does not work inside a fieldset in uikit v3. if you want to get rid of the frame, just remove the fieldset tag an place a v-show="status > 0" as form attribute to hide the form after submit.

    When I look at the code, I think they don't want to enforce reCaptcha. They only load the scripts if recaptcha is enabled:

    But they always verify the recaptcha, even if it is not enabled, so they abort the request on routes which require a captcha verification with a @Captcha(verify=true) annotation. Does somebody agree in opinion?

    Check this out:

    PHP: pagekit/app/system/index.php
    1. 'view.init' => function ($event, $view) use ($app) {
    2. $theme = $app->isAdmin() ? $app->module('system/theme') : $app['theme'];
    3. $view->map('layout', $theme->get('layout', 'views:template.php'));
    4. $view->addGlobal('theme', $app['theme']);
    5. },

    views:template.php is the theme template. Try to remap the layout:


    PHP: package/mercator/extension/index.php
    1. 'view.init' => function ($event, $view) use ($app) {
    2.     $layout = $app->config('my/extension')->get('layout');
    3.     $view->map('layout', "views:layout-$layout.php");
    4. }

    I think that should work.

    The required attribute prevents the submission/saving the page. Using Ctrl+s it does work. If its still not working use v-validate:required instead and remove required.

    You setup the forms with native html, how you style it is up to you.


    The extension only wraps your form with a template and mounts it with vue js application to be able to submit form data to the server, which sends the mail.

    Hey guys


    Some asked for a simple form extension. I just uploaded a beta version to the marketplace. Install it, head over to https://github.com/IamSAB/pagekit-form checkout the readme and copy its first form example to your pagekit editor on a random site to get started.

    Remember to set before the SMTP mail configuration correctly. I couldn't figure out, how to get PHP Mailer working ...

    Feel free to open issues or enhancements on github itself. Pull request are also welcome. Hope this extension meets your requirements.


    Don't forget about Christmas and what it is about. Enjoy it.


    Cheers,

    SAB