Posts by SPQRInc

    It pushed me in the right direction, thanks. I got a little error that was removed by this.

    But: The URL is still generated like this: https://localhost/books/item?slug=dies-ist-ein-test

    I would like to rewrite it to a pretty URL like https://localhost/books/dies-ist-ein-test

    My problem is that the URL needs to be generated with VueJS. And I do not get the link between Vue and the Pagekit routing.

    Hello again,

    working on my new extension I just stumbled over another issue related to the routing.

    My view generates a description list that is filtered "on the fly" using Vue.js.

    This is the part:

    1. <dl class="uk-description-list-line" v-for="item in filteredItems">
    2. <dt>{{item.title}}</dt>
    3. <dd v-if="item.excerpt.length">{{ item.excerpt }}</dd>
    4. <dd v-else>{{ item.content | truncate 150 }}</dd>
    5. </dl>

    Now I would like to add a link to every item that is shown. I can not use

    1. $view->url('@books/id', ['id' => $item->id])

    because $item does not exist as I'm not using a PHP-foreach to loop through the list (because the list can be filtered "on the fly").

    So now I'm using

    1. <a :href="$url.route('books/slug/', { slug: item.slug })">{{ item.title }}</a>

    And it works fine, but it generates links like this: https://localhost/books/slug?slug=dies-ist-ein-test

    Of course I can work with that, but it would be fine to get a pretty URL.

    As I can not find a documentation for this: Can I rewrite this using a custom routing ?

    Hello there,

    well - this seems to be so easy, but at the moment I'm having a dirty workaround.

    I got a computed property called "filteredItems". This "filteredItems" looks like this:

    1. { "7": { "url": false, "test": [], "id": 7, "status": 1, "slug": "dies-ist-ein-test", "title": "Dies ist ein Test" }, "8": { "url": false, "test": [], "id": 8, "status": 1, "slug": "zu-viele-items", "title": "Zu viele Items" }, "9": { "url": false, "test": [], "id": 9, "status": 1, "slug": "zu-viele-items-2", "title": "Zu viele Items - Copy" } }

    Or, if empty like this:

    1. {}

    Now I would like to show a text, if filteredItems is empty.

    But: The .length-method does not work here, so I can not do a simple

    1. <h3 class="uk-h1 uk-text-muted uk-text-center"
    2. v-show="!filteredItems.length">{{ 'No Items found.' | trans }}</h3>

    My dirty workaround is to check the length in the JS-file:

    1. if(Object.keys(result).length < 1) result = false;

    and do a

    1. <h3 class="uk-h1 uk-text-muted uk-text-center"
    2. v-show="!filteredItems">{{ 'No Items found.' | trans }}</h3>

    But this is not really elegant I think.

    Well, this is just a test-project: It displays all the books I read during my studies. The API returns the data to the frontend.

    But hopefully I'm going to release a new extension based on my new knowledge on routing within the next few days :-)

    Okay, that worked out.

    It also works if I do the following:


    Hello there,

    Here it is: My first Pagekit project: .

    It's a Website that provides information about reptiles that are kept in a terrarium.

    As you can see: The styling was not my focus. Instead of this I wrote a little extension that calculates the minimum size of a given number of animals - or, if you want to, gets the animals you can put into a existing terrarium with a size you can define.

    It also provides a calculator that returns the yearly energy costs of your equipment.

    It's a hobby-website and no one needs the extension I wrote for it, but I had a lot of fun developing it :-)


    I got a simple question about routes:

    I got these routes in my extension:

    1. 'routes' => [
    2. '/books' => [
    3. 'name' => '@books',
    4. 'controller' => [
    5. 'Spqr\\Books\\Controller\\BooksController',
    6. 'Spqr\\Books\\Controller\\ItemController',
    7. 'Spqr\\Books\\Controller\\SiteController'
    8. ]
    9. ],],

    Now I wanted to create an admin menu entry like this:

    Okay. So now I got these controllers loaded with @books.

    1. 'Spqr\\Books\\Controller\\BooksController',
    2. 'Spqr\\Books\\Controller\\ItemController',
    3. 'Spqr\\Books\\Controller\\SiteController'

    The BooksController starts with:

    The SiteController starts with:

    Now I thought that in the backend menu the item would be linked to /admin/books - but it's linked to /books/. But why?

    I always thought, the annotation

    1. /**
    2. * @Access(admin=true)
    3. * @return string
    4. */

    would automatically add the route to /admin?


    My first Pagekit extension is the Sitemap Generator, which was written, because the existing one in the marketplace did not correctly crawl my page and generated a faulty sitemap.

    My extension is crawling your website faster and allows you to create excluded sites that should not be added to your sitemap.


    More information

    Hello dear forum-users,

    this board is all-new and you can take part of it's development.

    I already created some categories and forums, but maybe you would like to see more categories or wish other categories.

    So: It's your turn. Tell us, how this board should be organized :-)

    I'm working on a widget which should have some "sub-items", which can be added in a modal.

    This is the source:

    Now I do not understand, why the validation fails (invalid value is shown) if I do not enter something to the text-field and hit Cancel). In this case the validation should not even happen?

    If I click a second time the modal closes as I wished.

    If I reload the page and try to remove an item the validation also fails. If I click a second time, everything works as expected.

    But: Why? The validator should not care about the remove-button and also not about the cancel-button

    Dear visitors,

    well - as you can see, this forum is quite empty at the moment.

    But: You can bring this board to life. It doesn't matter if you are a webmaster or a developer - this board is for everyone, who works with Pagekit CMS. Be it professionally or just for fun.

    Please feel free to ask - there are no "stupid questions" and the community is going to help you out.

    But: Please also notice that all of the supporters are volunteers. So please be patient and friendly.

    Have a good time!