Open djay opened 10 years ago
The more I think about it, the more I think the shortcode approach is worth trying. Assuming it works.
@jcerjak @optilude thoughts?
For those not aware of shortcodes http://codex.wordpress.org/Shortcode
I think it's worth trying, yes.
Not sure how it helps with preview though? — Sent from Mailbox for iPad
On Thu, Jan 30, 2014 at 1:34 AM, Dylan Jay notifications@github.com wrote:
For those not aware of shortcodes http://codex.wordpress.org/Shortcode
Reply to this email directly or view it on GitHub: https://github.com/collective/collective.tinymcetiles/issues/2#issuecomment-33652356
If it generates just HTML then that can go between the start and end tags in the editor. This will be replaced in the final view.
Including an actual HTML preview in tinymce is problematic because tinymce doesn't have a way to group elements together. So the user can just drag part of the preview somewhere else, and not realize that they broke things until after they save.
I'm not a big fan of square-bracketed short codes because it means we have to handle parsing them ourselves instead of just using existing, well-tested parsers for things like xml or json. But I guess it's probably not too bad...
We did some work on shortcodes for pyramid, where we basically reused the Wordpress regex, we could use that: https://github.com/fschulze/pyramid_snippets/blob/master/pyramid_snippets.py#L15
I agree that we definitely need more friendly shortcodes than query="[{v:'type', o:'plone.app.querystring.operation.string.is', v:'Page'}]"
an alternative to json for the listing tile is the zope marshalling. e.g.
[listing query.v:records='type' query.o:records='plone.app.querystring.operation.string.is' query.v:records:'Page']
and hopefully we can shorten that to
[listing query.v:records='type' query.o:records='string.is' query.v:records:'Page']
still a little long?
Still pretty unreadable, I was thinking more something like this :)
[listing type="Page,Event"]
Then we need to make mappings between these short params and the real deal. Would that work?
I guess its up the the tile what params it wants to take. We can improve the friendliness of the listingtile overtime I guess.
Adding a persistent tile works now, but we need to fix the edit. And we need to make sure it works also for transient tiles. Will continue with the work next week.
I should be able to do some work on this during the week. I think the priority is to get the shortcode work stable enough that it works with the demo. Then we can merge it. Note the demo doesn't yet include the ability to edit a tile thats been inserted but it probably should.
After that we need to work on the TODO items in the .robot file. That should help focus us on getting the demo finished :)
Also note we have travis passing our demo now. We can use that to measure our progress
Few ways could solve this
For example a syntax similar to shortcodes such as
Users can change the settings of the tile themselves. If they change the preview html inbetween then it will get ignored. Alternatively some tiles might like to use the inbetween html as part of it's configuration?