Comments (4)
Thanks for the heads-up. First, you can delete site/plugins/content-viewer/templates/content-viewer-source.php
, as it is a leftover from some experimentation and does nothing. I'll remove it in the next release.
Unfortunately, Kirby doesn't make it easy for plugin authors to add a CSS file to the panel, which is why I'm using <style>
tags, and ultimately why there is duplication. The simplest solution would require each user of the plugin to add some code to their config
file, which I'm loath to do as every additional required step is one more way for things to break. I'll give it some thought. Do you have any suggestions for methods to do this?
from content-viewer.
I actually have already done a quick (and probably not the cleanest) fix. Might as well fork and create a pull request, if you wish.
But you may do it yourself, here's everything you'll need: How to store plugin assets | Kirby.
Especially this:
As long as you store your assets in the assets folder, your assets are publicly available at the following URL:
http://{domain}/assets/plugins/{pluginName}/{optionalSubfolder}/{filename}
So you just create assets
folder in the root of the plugin (site/plugins/content-viewer
), put style.css
there. Then you can echo the asset like always, using:
<?= css('assets/plugins/content-viewer/style.css') ?>
.
Any additional styles might be then added to a particular template using <style>
, but I guess that it would be better anyway to just add these styles to the style.css
file and apply them with a class. For example, when viewing the file in a new window, I would just apply a class .new-window
, and if viewing as a widget, the class wouldn't be applied. That's all.
Also, thanks for the plugin. Great work you're doing there! Keep it up for sure :)
from content-viewer.
Thanks @mciszczon! I'm implementing it as we speak.
from content-viewer.
Amongst a bunch of other things, it's fixed now in 1.2.0!
from content-viewer.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from content-viewer.