sylvainjule / kirby-pagetable Goto Github PK
View Code? Open in Web Editor NEWDisplay subpages in a flexible table section. Kirby 3 only.
License: MIT License
Display subpages in a flexible table section. Kirby 3 only.
License: MIT License
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.
is it possible that you give me a small hint on how to edit the field method for multi categories?
thanks!
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.
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).
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.
The little green / red / blue dot is not showing anymore on Pagetable after the update of Kirby v.3.5.0.
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?
If possible.
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?
return array(
'pagetable.rowsPerPage' =>
Translation in language file doesn't change translation in backend.
Also custom string https://github.com/sylvainjule/kirby-pagetable#34-custom-strings
translations:
rowsPerPage:
doesn't work
# 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;
}
]
]);
I would like to have a similar functionality but for files.
Would it be possible to extend it to a "FilePageTable" plugin?
mypagetable:
search: true | false
If possible. After #5
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
headline
that you will see in above screenshot and empty html tag in following screenshot: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:
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?
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.
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")
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.
I'm getting following error on 3.6.0-alpha versions.
Uncaught TypeError: Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined
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.
Message pops up by clicking an item.
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.
When you write to filter the pages, the pagination does not restart.
this causes the results not to appear.
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.
File sections would benefit from search, a per-page select, and sorting by column. Any reason this doesn't yet support file sections?
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? ;)
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)
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
:
Am I doing something wrong or is this a bug?
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
Using image previews in small size instead of the original would be great for performance.
Similiar fixed Kirby issue: getkirby/kirby#2039
// 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
];
}
Restore current search + sorting + displayed rows / page + current page, when navigating back and forth.
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
Links to the 'nnnnext' url, not public website.
Is there any hope for an update where i could update the field's content right from the table cell?
As in the Kirby structure field, the dynamic width feature would be very useful.
https://getkirby.com/docs/reference/panel/fields/structure#table-columns
columns:
title:
width: 3/5
images:
width: 1/5
price:
width: 1/10
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...
The new duplicate modal doesn't open when clicking on the option from a pagetable.
I hope it's a minor and just not connected yet.
Anyways, I'm so thankful for this plugin and appreciate all your work! ❤️
Kirby 3.2.0 seems to introduce a change that breaks kirby-pagetable's
add button.
You can find the corresponding change here:
getkirby/kirby@826ef9a#diff-60692e3c1778944054f0f5f3ac79cad4L10
Applying the very same change as on line 10 to https://github.com/sylvainjule/kirby-pagetable/blob/master/src/sections/PageTable.vue#L8 fixed the issue on my local test setup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.