smart-village-solutions / Goldencobra

CMS based on modules as Rails 4 engines
Other
21 stars 15 forks source link

widgets per liquid tag #120

Open donni106 opened 6 years ago

donni106 commented 6 years ago

Description

The idea came up to make widgets possible via liquid tags. This would allow the use of random contents inside string or text fields. Currently widgets are rendered on fix positions in views. It is difficult to render a widget between two contents. To realize this case, we need to have two string/text fields and define a widget position in between. This is very inflexible.

Expected results

The use of widgets per liquid tags would allow a more flexible way for creating pages. You do not need to define fixed positions in views. For sidebars or footers, the use of fixed positions is still useful and necessary.

Example

When writing a page content, it could be like this:

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores 
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est 
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur 
sadipscing elitr. 

{% widget 12 %}

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan 
et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis 
dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer 
adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore 
magna aliquam erat volutpat. 

Is this possible?

marcometz commented 6 years ago

Very nice idea. But I would rather describe a widget position with the liquid tag and then assign widgets using the known functionality.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores 
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est 
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur 
sadipscing elitr. 

{% widget sidebar %}

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan 
et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis 
dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer 
adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore 
magna aliquam erat volutpat. 

So several widgets could be rendered at the place and the assignment to the article remains more flexible as before

donni106 commented 6 years ago

{% widget sidebar %}

With that, we have to take care about the following:

Currently widget positions are defined per article type. When additionally defining widget positions in single articles, it can be confusing and users may ask, why widgets are not rendered!?

donni106 commented 6 years ago

And we have to maintain a clean list of possible positions per article:

bildschirmfoto 2018-08-31 um 17 29 05

Currently every position is listed and not only for this article possible. With a new liquid, this list depends also on nested widgets and their containing positions.

pwilimzig commented 5 years ago

Maybe the selection of the widget position could work like the selection of the image position? I think that would be more flexibel and clearer.

bildschirmfoto 2019-01-28 um 16 56 55