sylvainjule / kirby-previews Goto Github PK
View Code? Open in Web Editor NEWAdd some missing structure previews. Kirby 3 only.
Add some missing structure previews. Kirby 3 only.
Kirby's default for listing image entries in a structure field table is to simply show a tiny little square preview of the image. Often, that is not sufficient, and we need more information - eg.: the file name, the file dimensions, the file size, etc.
It would be wonderful if Kirby Previews could enable the user to optionally display added file information in these entries - perhaps via config options. Example:
<?php
return [
// toggle thumbnail previews for images
'sylvainjule.kirbypreviews.filethumb' => false,
// extra information to display for file/image fields
'sylvainjule.kirbypreviews.fileinfo' => "{{ file.filename }}"
];
I’m not sure whether this is a bug or a feature but I’m getting an additional unintended color preview if I’m using HTML color names for tooltips.
This is my blueprint:
label: Farbe
type: color-palette
options:
color1:
background: '#01438E'
tooltip: Dunkelblau
color2:
background: '#97BEE3'
tooltip: Hellblau
color3:
background: '#E30513'
tooltip: Rot
color4:
background: '#E3BF8A'
tooltip: Beige
default: color1
In color4 I’m using the name “beige” for the tooltip, and this is what I get in the preview:
There is a second color which is apparently using the color name from the tooltip text. It’s similar if I’m using “red” as tooltip text, for example; then it will just add a red square next to the primary color.
Inspecting the element with the browser’s developer tools, this is the output I see:
<div class="k-color-palette-field-preview" column="[object Object]" field="[object Object]">
<div class="color-preview" style="background-color: rgb(227, 191, 138);"></div>
<div class="color-preview" style="background-color: beige;"></div>
<div class="color-preview"></div>
</div>
Also, this [object Object]
stuff doesn’t look right to me either. It seems like this is some JS failing to print the output of an object.
Thank you very much for this useful plugin. Would you mind adding support for the colors plugin, too? I’d be very gateful.
This plugin cannot be installed via composer as suggested.
Up to now it is not listed on packagist: https://packagist.org/?query=sylvainjule
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.