Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hard to place a rapido app in a site #9

Open
djay opened this issue Jun 11, 2016 · 4 comments
Open

hard to place a rapido app in a site #9

djay opened this issue Jun 11, 2016 · 4 comments

Comments

@djay
Copy link
Member

djay commented Jun 11, 2016

User problem

Lets I have an function that I want to be in /voting and fill up the main content and subtree of that part of the site.

Options

diazo path conditional (current)

Currently you can do that my using diazo with a path expression. But this is brittle, as I might change that folder id.

Special content type (current)

You could use DX to create a special one off content type and then use diazo to override the default view e.g.

<replace css:content="body.template-view.portaltype-specialcontent #content">
  <include css:content="form" href="@@rapido/myapp/block/myblock" />
</replace>

sub urls would fail however.

tinymce style (current)

Alternatively I could create a tinymce style, create a page with any id and insert the style into my page.

rapido tile (current)

Make the page a mosaic page, insert a rapido tile and select the block.

displayview

  • Add a new setting inside a block settings set displayviewname="My app".
  • optionally in the block settings set "displayviewcontentypes" to a list of content types to show this displayview as an option for. Might also be an expression?
  • user creates a page/folder and selects "my app" from the display view.

alternatively it could work as follows

  • User creates a new block
  • User goes to the site setup > types and picks the content type
  • User can select which views to make available for a given type. All rapido blocks show up as options.

Here is the code needed to add a new display menu item dynamically - https://github.com/collective/collective.listingviews/blob/master/src/collective/listingviews/browser/views/controlpanel.py#L84

new tile type

Instead of having a single rapido tile, rapido could be used to create new types of tiles. Could work something like this

  • in a block settings, set tilename = "my app"
  • optionally set tilesettingsblock = mytilesettings. This allows another block to be used if someone wants to give paramaters to their tile.
  • the tilesettingsblock python would use some tiles api to set various params for storage inside the tile. and the view block would just use request to access those.
  • editor drags "my app" tile onto their layout. Clicks edit, sees mytilesettings block to set and save the settings.

jbot replacement

In a blocks settings specify which view you want it to override. Then the block will act likr jbot and replace the template part of a browserview. The blocks template will have access to the original view object as well as its own elements.
This would mean if the user was technical enough to know the view path they could rewrite the view using rapido. For instance to override a viewlet or DX edit view or display view for a particular content type.

@djay
Copy link
Member Author

djay commented Jun 11, 2016

@ebrehault I think I like the "new tile type" idea. ideally it would be nice if rapido could take advantage of DX schema so that you didn't have to write a lot of code handle simple settings. maybe if could use z3cform fields as elements, and perhaps leave the html blank? then maybe have a single submit function?

@ebrehault
Copy link
Member

Yes, being able to turn a given block into a tile would be very nice, and that's something I plan to do.

Note: it is certainly possible to use dexterity and/or z3c.form in rapido, but the resulting code would be very complex, and I want rapido to keep simple. Nevertheless, I also think using the form tooling of Plone in Rapido is interesting, and my approach in a recent project was just to use collective.easyform: the user manages form fields with EasyForm, and my block just call the form rendering and then process/store the data. That's very simple and it avoids to bring the dx/z3c.form complexity into rapido directly.

@djay
Copy link
Member Author

djay commented Jun 13, 2016

Interesting approach. Means you global theme based code relying on a form in a specific location which doesn't seem to logically make sense. But I guess its not that much different to hooking rapido into a specific path using diazo. Not sure if its possible to get a collective.easyform to use rapido to handle submission which would make more logical sense.
In terms of rapido using z3cform widgets directly I think its a nice to have but thinking about it more, it doesn't solve a big problem. It just makes it quicker to create certain kinds of forms and take advantage patternslib more easily. For example if you want a mutltiselect, or autocomplete. I'm not sure it makes sense for rapido to make its own versions of those?

@djay
Copy link
Member Author

djay commented Jun 27, 2016

I just added in the jbot replacement option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants