nliautaud / pico-content-editor Goto Github PK
View Code? Open in Web Editor NEWA WYSIWYG content editor plugin for Pico CMS
License: MIT License
A WYSIWYG content editor plugin for Pico CMS
License: MIT License
If the Markdown Extra attribute markdown=1
is set in a data-editable
block, the content is
converted back to Markdown on save.
<div data-editable data-name="pages-first-content" markdown=1>
- one
- two
</div><!--end editable-->
I added to config
$config['users'] = array(
'admin' => '???',
'editors' => array(
'bill' => '???'
)
);
$config['rights'] = array(
'PicoContentEditor' => 'admin',
'PicoContentEditor/save' => 'editors',
);
added to index.twig
{{ content_editor }}
{{ login_form }}
</body>
Authentitication working, but content_editor with pico users don't working.
I use latest version plugins .
Without pico-users plugin pico-content-editor working correctly.
I manually installed PicoCMS v2.1.4 and figured out how to create .md home page and sub pages. Then I downloaded and manually moved PicoContentEditor to /plugins where it is the only plugin besides PicoDeprecated. I immediately ran into problems with nothing showing on pages and an indication of 500 Internal Server Error. When I removed the PCE plugin, the pages started working again.
I noticed that PicoContentEditor.php is using API v2, while it looks like Pico v2.1.x uses API v3. I tried editing PCE.php to use v3, but that did not make any difference--the pages were still blank. Is PCE compatible with Pico v2.1.4?
Thanks,
Tim
Hello,
It would be great to be able to manage existing images, it seems that now "ContenTools" supports this new feature.
'https://github.com/GetmeUK/ContentTools/pull/493'
See http://getcontenttools.com/tutorials/handling-image-uploads
What would be the best way to support editable blocks in theme ?
In themes, editable blocks may be located in included files, so their origin have to be determined.
Maybe :
editable-src="path/file.twig"
attribute in blocks that would provide a relative patheditable-src
file, or the current page if not providedMake PicoUser optional, and detect it. If installed do actions only for authorized users.
A setting may be provided to define the authorized users, maybe using PicoUsers rights
:
$config['rights'] = array(
'PicoContentEditor.save' = 'admin'
);
Pico CMS and Pico Content Editor installed with Composer on Apache 2 (Ubuntu 18.04).
After editing an editable area and pressing Save button a new result is not saved.
On screen error message is "error replacing region content".
Browser console error message is "Failed to load resource: the server responded with a status of 405 (Method Not Allowed)" or "POST ... Error 405 method not allowed"
Apache config
<Directory /var/www/>
AllowOverride all
Require all granted
</Directory>
Pico CMS config
PicoContentEditor:
show: true # show/hide the editor
debug: true # enable errors reporting
Editable content
<div data-editable data-name="pages-first-content" data-markdown markdown=1>
Start page
</div><!--end editable-->
Ones more strings from Browser console
PicoContentEditor : SAVE
Object
regions:
pages-first-content: {markdown: false, html: "<p>↵ Start Page 35564↵</p>"}
__proto__: Object
__proto__: Object
Is it possible to also create new page? If I have blog or news page, I want users be able to easily create new posts.
vendor/autoload.php is missing from the repo, but required in PicoContentEditor.php
When I try to install the plugin, I get this error:
{"reqId":"YMK3uXd0L25lwOzRYOkYAQAB8Qk","level":3,"time":"2021-06-11T01:09:19+00:00","remoteAddr":"[IP_ADDRESS]","user":"[USERNAME]","app":"PHP","method":"POST","url":"/index.php/apps/cms_pico/admin/plugins","message":"require(): Failed opening required '/home/[DOMAIN]/www/cloud/apps/cms_pico/appdata_public/plugins/yOv9TEVuUi/PicoContentEditor/vendor/autoload.php' (include_path='/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Crypt_Blowfish:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Date:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Exception:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Idna:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_ListHeaders:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mail:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_ManageSieve:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Nls:/home/[DOMAIN]/www/cloud/apps/mail/vendor/pear-pear.horde.org/Horde_Secret:/home/[DOMAIN]/www/cloud/apps/mail at /home/[DOMAIN]/www/cloud/apps/cms_pico/appdata_public/plugins/yOv9TEVuUi/PicoContentEditor/PicoContentEditor.php#2"}
Great plugin, thank you for sharing.
I have installed the editor and all seems good except uploading images. they get uploaded to the images folder, but cannot insert them into content.
Have tried on Pico V1 and the 2 beta with same results. Running PHP 7.2.1
Here is the logs from console and any suggestions to solve much appreciated:
File(13539) {name: "avatar04.png", lastModified: 1499535957000, lastModifiedDate: Sat Jul 08 2017 12:45:57 GMT-0500 (Central Daylight Time), webkitRelativePath: "", size: 13539, …}lastModified: 1499535957000lastModifiedDate: Sat Jul 08 2017 12:45:57 GMT-0500 (Central Daylight Time) {}name: "avatar04.png"size: 13539type: "image/png"webkitRelativePath: ""__proto__: File
Uncaught TypeError: Cannot read property 'path' of undefined
at XMLHttpRequest.xhrComplete (editor.js:73)
xhrComplete @ editor.js:73
XMLHttpRequest.send (async)
(anonymous) @ editor.js:104
a.dispatchEvent @ content-tools.min.js:4
(anonymous) @ content-tools.min.js:5
For now the editable blocks are parsed trough regex. That's ugly and not flexible, but it works.
The two main issues are the need of a "ending mark" comment <!--end editable-->
, and the rigidity of supported attributes.
To use a proper HTML parser, we'd need to find how to replace a specific zone (or node content) without altering any outer content, even if it's not proper html. It would be the parser job to return the full content with localized changes, but the tried parsers, when given non-html content (ex. markdown) were altering unknown parts.
An alternative would be to keep regex but get rid of html blocks, and use custom tags or twig functions, but it would add a layer between the user and ContentTools that may be worse.
Add response notifications. The plugin return a JSON response such as :
{
"status" : [ { "state": false, "message" : "An error occured" } ]
}
For some reason every page returns a 500 Internal Server error after installing PicoContentEditor.
I have cloned the latest version of the repository, renamed the directory PicoContentEditor and changed its ownership to www-data. I am using the pagination, search, and users plugins. They work on their own, but not with the Content Editor.
I found that the errors are seemingly because the __DIR__ variable is being used to find PicoCMS's directory, but is instead returning PCE's directory
Hello! I have a strange case. When I save a document, the same symbol disappears from it. Cyrillic letter - x.
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.