Code Monkey home page Code Monkey logo

kirby-pagetable's People

Contributors

afbora avatar bastianallgeier avatar cydgoblin avatar davidelanfranchi avatar distantnative avatar dorb4n avatar johannschopplich avatar romanustin avatar s1syphos avatar s3ththompson avatar steirico avatar stevenworldplay avatar sylvainjule avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kirby-pagetable's Issues

all data gone when changing URL appendix (changing page's name)

i find the plugin pretty helpfull, but i just came accross something quite nasty. if i try to change the pages URL my whole content is gone!!! which can be extremely critical. changing just the pages name is fine, but when you re-generate the url (or just change it by hand) the site refreshes and all content is gone. luckily there is the possibility of reverting before saving, but it really gave me a scare.

can you please look into this?

using kirby 3.5.6 and multi-language setup.

Persistent navigation

Restore current search + sorting + displayed rows / page + current page, when navigating back and forth.

Make empty section prettier

In my opinion, an empty pagetable section uses a lot of space and doesn’t look very nice:

Bildschirmfoto 2020-05-25 um 15 37 17

The "filter pages" field is unnecessary and could be hidden, as well as the table head.
I think the pages section is a good and subtile example:

Bildschirmfoto 2020-05-25 um 15 38 20

The pagetable could look exactly like this.

Issue with spanish translations

I would like to translate the plugin. I tried addint the language on the index file and the languages folder but it did not work. Any suggestions?

Can't correct date output format get to work

I am trying to label a column with a year that I receive from a date on the page.

My original date is formatted like this: Earliestdate: 2019-02-06

Following the documentation, I have set up my bluprint like this:

date:
  label: Jahr
  type: date
  text: '{{ page.earliestdate("Y-m-d") }}'
  dateInputFormat: 'YYYY-MM-DD'
  dateOutputFormat: 'YYYY'
  width: 1/6

However, this still renders a complete date like that (no matter how I change the dateOutputFormat:

20200215-013805_Screenshot_GoogleChrome

Am I doing something wrong or is this a bug?

Kirby\Cms\Page::dragText() must be of the type string, null given

No pages loaded, just empty table with No pages yet message.

Console output

code: 500
details: []
exception: "TypeError"
file: "/kirby/src/Cms/Page.php"
key: null
line: 414
message: "Argument 1 passed to Kirby\Cms\Page::dragText() must be of the type string, null given, called in /home/xxx/site/plugins/kirby-pagetable/lib/pagetable.php on line 124"
route: "pages/([a-zA-Z0-9\.\-_%= \+\@\(\)]+)/sections/([a-zA-Z0-9\.\-_%= \+\@\(\)]+)"
status: "error"

Kirby version: 3.2.5-RC.2

About commits

getkirby/kirby@a31616a#diff-cc18a549d85f70256e182c297c5f2789

getkirby/kirby@2256afd#diff-cc18a549d85f70256e182c297c5f2789

Issue line:
https://github.com/sylvainjule/kirby-pagetable/blob/master/lib/pagetable.php#L124

I searched the $this->dragTextType variable but i couldn't find anything.

class option not woking

  // loop through the user display choices
            foreach($this->columns as $key => $column) {
                $type       = $column['type'] ?? 'text';
                $label      = $column['label'] ?? ucfirst($key);
                $label      = I18n::translate($label, $label);
                $data['columns'][] = [
                    'label'  => $label,
                    'field'  => $key,
                    'type'   => $type,
                    'sort'   => $column['sortable'] ?? true,
                    'search' => $column['searchable'] ?? true,
                    'class' => $column['class'] ?? true, // MISSING LINE
                    'width'  => $column['width'] ?? null
                ];
            }

r.log is not a function

don't know for sure its an pagetable issue, but i thinking so.
i'm getting an "r.log is not a function" when clicking on a page in the pagetable. what does that mean and how i get rid of it?

screenshot_234

Display the value of 2+ fields as text in a column

# site/blueprints/*.yml
...
  columns:
    example:
      text: '{{ page.checkboxesValues }}'
Kirby::plugin('my/page-methods', [
    'pageMethods' => [
        'checkboxesValues' => function () {
            $first       = $this->first()->value();
            $second = $this->second()->value();
            // ...
            // do something with $first and $second if needed
            return $first . ' ' . $second;
        }
    ]
]);

Preview Thumbnails are not thumbs but original images

The pagetable section seems to not show a small thumbnail but the original image instead. Can this be? It occurred to me in 2 completely separate installations, both running the current Kirby and current plugin version. This makes the backend very slow. It happens on my Apache web host and locally, while the thumbnails for the regular page sections get delivered as usual.

It looks like the thumbnail image gets selected here:
https://github.com/sylvainjule/kirby-pagetable/blob/master/lib/pagetable.php#L200
using the panelImage()method:

$thumb = ['width' => 100, 'height' => 100];
$image = $item->panelImage($this->image, $thumb);

When I look at the definition of that method
https://github.com/getkirby/kirby/blob/3.5.1/src/Cms/ModelWithContent.php#L388
it apparently takes only one argument:

function panelImage( string|array|false|null $settings = null): ?array

Can this somehow cause for the section to show not the usual 72x72 thumbnail, but the original image instead?

I played a little bit to try different inputs in that $settings-thing, but I couldn’t manage to get the desired result.

Can someone reproduce the problem? Or am I the only one? ;)

Sort via drag & drop

Any chance of being able to sort the pages via drag & drop as in the normal Kirby pages section?

Thanks for this great plugin, comes in very handy for a site I am working on right now.

Add files to the table

I would like to have a similar functionality but for files.
Would it be possible to extend it to a "FilePageTable" plugin?

Limit option does not work

This problem was mentioned also mentioned in #27, but it still does not seem to be solved.

When I use the limit option, the value I set there will be ignored and it always sets the default limit to 5 (I can use the dropdown, but I would like to initially set the limit to a different value than 5).

Field of type toggle is empty in table when using fieldMethods

In my blueprint I have:

merchant_categories:
    type: pagetable
    headline: Handlare
    create: merchant
    status: all
    limit: 100
    columns:
        local_image_save_to_s3:
        label: S3-bucket
        text: '{{page.local_image_save_to_s3.statusLabel}}'
        type: text
        searchable: false

local_image_save_to_s3 is a type toggle in the subpage blueprint

local_image_save_to_s3:
    label: Spara produktbild till S3-bucket?
    type: toggle
    text: 
        - Nej
        - Ja
        default: false

Inside plugins/my-methods/index.php I have this fieldMethod:

Kirby::plugin('mashplan/StatuslabelField', [
  'fieldMethods' => [
      'statusLabel' => function($field) {
        $value = $field->value;
        return '<span class="status-label" data-status-type="'. $value .'">' . $value . '</span>';
      },
  ]
]);

This fieldMethod works fine on another field which is of type text but on this one of type toggle it is empty

Make fields editable

Is there any hope for an update where i could update the field's content right from the table cell?

Performance with large sections.

I have a section containing ~500 pages, rendering this table takes quite a while (even when localhost) where as the native Kirby 3 sub-page list performs quite quickly.

Is there anything that can be done to improve this?

"Add page" leads to error

The following demo template will produce an error as soon I click to add an page: Cannot read property 'id' of null.

title: Test

sections:
  draft:
    type: pagetable

image

Use field previews?

Hi thanks for the nice plugin you made.
Maybe I'm missing something really obvious, but is it possible in this table to use field previews such as for users, files, pages...

Translatable empty placeholder

It would be nice to be able to change the text when the table is empty.

products:
    headline: Products
    type: pagetable
    empty: You have not added any products yet

use different URL in table

Hi,

thanks for this great enhancement of the kirby CMS which i like a lot!

I wondering how difficult it would be to manipulate the URL being used a link in the table. In my usecase i use different blueprints according to the users' role. A certain role shall not be able to edit the pages being shown in the list (i use a certain hook to finally prevent editing). Nevertheless he should see the listed pages and he should click on the pages BUT i'd like to link to the preview page.

I thought about adding a custom option show preview rather than panel and use $item->pageUrl rather then panelUrl or alike.

Any suggestion on how to achieve this kind of feature?

Thanks in advance and all the best, Thomas E.-E.

No results message

FireShot Capture 764 - Ürünler - Akyüz Plastik Satış - http___shop akyuz com tr_panel_pages_urunler

If no search results, no message seen.
An informative message would be nice.

CSS selector in the README does not target anything

Just a quick heads up, I think there is a small error in the docs. There is this section in the README.md:

.k-pagetable-section .category-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 5px 7px;
  border-radius: 3px;
}
.k-pagetable-section .category-label[data-category="architecture"] {
  background: #d7e1e9;
}
.k-pagetable-section .category-label[data-category="culture"] {
  background: #f5e6bf;
}
.k-pagetable-section .category-label[data-category="environment"] {
  background: #cae5dd;
}
.k-pagetable-section .category-label[data-category="gastronomy"] {
  background: #e0d7dd;
}
.k-pagetable-section .category-label[data-category="science"] {
  background: #f9e9e0;
}

However, that does not seem to target anything in the panel. If I change all the .k-pagetable-section to just .k-section, it works again.

Incompatible with 3.6.0

I'm getting following error on 3.6.0-alpha versions.

Uncaught TypeError: Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined

Optional custom term for displayed items

First off: Thanks for the great plugin! I think it could be very helpful to be able to set up a custom term for displayed items. So instead of "filter pages" there could be "filter projects/contacts/posts... etc.". Same goes for "pages displayed" at the bottom.

Headline and limitOptions dropdown issue

FireShot Capture 716 - Katalog - PixelShop - http___pixelshop com_panel_pages_urunler

Here my blueprint:

sections:
    mypagetable:
        headline: Ürünler
        type: pagetable
        status: all
        image:
            cover: true
        columns:
            title:
                label: Ürün Adı
                text: '{{ page.title }}'
                width: 3/6
            price:
                label: Fiyat
                text: '{{ page.price }} / <del>{{ page.priceTag }}</del>'
                width: 1/6
            stock:
                label: Stok
                text: '{{ page.quantity.toInt }}'
                width: 1/6
            date:
                label: Tarih
                type: date
                text: '{{ page.createdAt.toDate("Y-m-d") }}'
                dateInputFormat: 'YYYY-MM-DD'
                dateOutputFormat: 'MMMM YYYY'
                width: 1/6
  1. Do not appear headline that you will see in above screenshot and empty html tag in following screenshot:

ss2

  1. Limit Options dropdown selected item not seen like your screenshot, as if there is a css problem:

ss

virtual parent

Would be super cool if it was possible to query a "virtual parent" to list pages. So it will be possible to list pages from grandchildren or pages by template.

merchants:
    type: pagetable
    headline: Merchants
    create: merchant
    status: all
    limit: 100
    parent: site.index.findBy("intendedTemplate", "merchant")

Sort by two number fields

I have some pages that represent articles. Each article has a volume and a number. (For example: Volume 1, Number 10. Volume 12, Number 3.) I need to be able to sort (and hopefully search) by both the volume and number.

So far the best I could come up with was something like this:
image

I need to pad the volume/number with a zero so that they sort correctly. Otherwise it puts Volume 10 before Volume 2.

If I put the volume in one column and the number in the other I can sort correctly by volume but the number column is randomly sorted which kind of defeats the purpose.

Ideally I wouldn't need to pad the numbers to get them to sort correctly. Also, this makes it difficult to search by volume and number since you have to pad the digits in the search field too. Is there an easy way to solve this?

Custom field names do not work

As soon as I add the translations field in my blueprint as described in the docs, suddenly my pagetable does not list any pages anymore. Any way to fix this?

Does also not matter which language I choose in the panel, the pagetable stays empty.

Limit option not working?

Can anybody confirm that the limit option is currently not working?

I'm trying limit: 50 but the list still shows only 10 items per page (and yes, there are more than 10 items)

Filtering pages

Hi!
Core pages has this in "ideas" but since that might take very long time i will have to solve this soon. Instead of writing it myself maybe there is chance to improve pagetable. Maybe it is too far from aim of pagetable.

Example:
I have page "project" that groups pages "outputs". The relation is defined in the "output" page - it is simple select field with query of all projects. But it would be most useful to see which outputs are linked from the project page. So instead of parent it would be awesome to define query. Not sure if it would be even possible.

outputs:
  type: pagetable
  parent: site.find("outputs").children.filterBy('linkedToProject', page.uri)

More i am thinking about it it is probably better to create separate plugin. This should be read only link. All that interface wouldn't make sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.