collective / collective.tinymcetiles

Allows inserting tiles into rich text bodies of content objects via a tinymce plugin
0 stars 1 forks source link

need in-editor preview of tile, or at least identify tile to marker #2

Open djay opened 10 years ago

djay commented 10 years ago

Few ways could solve this

For example a syntax similar to shortcodes such as

[[@@plone.app.contentlistingtile query="[{v:'type', o:'plone.app.querystring.operation.string.is', v:'Page'}]"]
  <table ...
 </table>
[/@@plone.app.contentlistingtile]]

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?

djay commented 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?

djay commented 10 years ago

For those not aware of shortcodes http://codex.wordpress.org/Shortcode

optilude commented 10 years ago

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

djay commented 10 years ago

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.

davisagli commented 10 years ago

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...

jcerjak commented 10 years ago

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'}]"

djay commented 10 years ago

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?

jcerjak commented 10 years ago

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?

djay commented 10 years ago

I guess its up the the tile what params it wants to take. We can improve the friendliness of the listingtile overtime I guess.

jcerjak commented 10 years ago

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.

djay commented 10 years ago

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 :)

https://github.com/collective/collective.tinymcetiles/blob/master/collective/tinymcetiles/tests/test_acceptance.robot#L53

Also note we have travis passing our demo now. We can use that to measure our progress

https://travis-ci.org/collective/collective.tinymcetiles