Posts by SAB

    The plugin is applied like that:


    1. Search for an send tag inside the page
    2. If found, get the parent form tag and add all the inputs to the form config
    3. Add the forms.js and the config to the view
    4. In forms.js for each form, form.js is used as compoent mounted to the respetive form element.
      This file has the child component send.vue, what will cause to render the send tag as vue component.

    You don't have to add v-show to the error slot, as it is only shown if status == 3


    Hey, finally found it :D

    Now things are clear to me. The view shortcut now make sense!


    In an extension, you should render all templates with {extension-name}{/path/to/template.php}. Following this convention, you make it possible, the theme can overwrite this template with the appropriate folder structure views/{extension-name}{/path/to/overwrite.php}.


    You can only overwrite this views from a theme, as the view: shortcut always directs to views folder of the activated theme. (Similar to theme: which points to the theme root, depending if you are in backend or frontend as they also used different themes)


    I did now about the shortcut, but did not actually know, why they used implemented it that way ... now I know, it was because of the overwriting thing.


    Cheers,

    SAB

    Hey


    I want to find the implementation of following feature in pagekit code, but cannot find it anywhere:


    If I add my-theme/views/system/site/page.php it overwrites without any further code the default page template of pagekit. The same you can do with blog views.


    My goal is to find that piece of code in pagekit source, as I want to know, if I can adapt it and if it applies also for extensions.


    Any help appreciated.

    SAB

    It is enough to just check the invalid property, as it gets true as soon one validator of the field fails. So it's the general state. If you use multiple validators on a field and you want to give more specific messages, then you can check the value of the validator itself.


    The email validator is a regex of pagekit/vue-form, there could be an error.

    JavaScript: vue-form/src/validators.js
    1. export function email(value) {
    2. return /^([a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*)?$/i.test(value || 'a@a.aa');
    3. }


    The validator for email & url are by default set. Actually you can just add the plain attributes, without the prefix v-validate:, as the extension sets it itself. That allows to use html5 validation and vue validation in one go.


    Available validators:

    Applying the validators:

    I planned to set more validators by default, but I can confirm, that some have unexpected behaviour e.g. maxlength returns false if no value provided ...

    Is that valid vue syntax? v-if="form.email.invalid" && v-if="form.email.email"

    Souldn't it be v-if="form.email.invalid && form.email.email"?

    You cannot use a instance method to get the data. It has to be a callback function. Use instead computed properties or even better set the data on the created instance hook as you retrieve data with xhr. If you want to update later the data, you can also register a watcher.

    I also noticed for a site of mine, where somebody is mentioned on a page, then if you search the name on google images, images on that same page appear in the result, even I didn't "programmed" google to know this ...

    Mercator you can use every input value when you use "dynamic" attributes ( in vue js v-bind: or shorthand just :)


    PHP
    1. <input type="email" name="email">
    2. <input name="subject">
    3. <send :to="email" :subject="subject"></send>


    I updated the form to v1.0.3 as I removed the captcha fix which is now solved with the new pagekit version. But it is still not installable from marketplace ...

    The two attributes you can create with another tab via a vue compoenent in the node settings (same approach as in a theme). The default config can be added within your index.php with the node index.

    If it is possible to simple unset single nodes when listening to the node init event, then you are not forced to overwrite a template, so you'll write just a very simple extension.

    You could listen to the the database event model.node.init. Then you got I think two options:


    First check if your node for your publish requirement, then

    1. try unset($node)
    2. otherwise set something like $node->data('show', false) & check for it in the menu render for hiding it
      (but this does actually not remove the node, so you could still view it, if you know the slug or id)



    Defined here:

    PHP: pagekit/app/modules/database/src/Events.php
    1. /**
    2. * This event occurs after an entity is loaded.
    3. *
    4. * @var string
    5. */
    6. const INIT = 'init';

    Gets called here:

    Gets used once in pagekit source code:

    PHP: pagekit/app/system/modules/site/src/Event/NodesListener.php
    1. public function onNodeInit($event, $node)
    2. {
    3. if ('link' === $node->type && $node->get('redirect')) {
    4. $node->link = $node->path;
    5. }
    6. }

    You could open an issue at their repo, as this breaks some functionality of the scoped uikit version. I think the'll fix that when mentioned for the final release.

    No, you can't. But you can define a priority to your event. The bigger the number the earlier it executes (relative to other subscribers.

    So you can run your listeners functions before or after the pagekit's authorization. This way, you can eventually influence their behaviour and achieve your goal.


    Code
    1. 'request' => [
    2.     ['onEarlyRequest', 90],
    3.     ['onLateRequest' -90]
    4. ]

    As I know, the priority spans from 150 (most important), to -150 (least important).

    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.