Problem/Motivation

We have a demo module with example paragraphs form #2427977: Demo module for paragraphs
Still output is functional, we have not even a typical example for the common layout situations a content creator can choose from... Possibly one of the key reasons why paragraphs exists.

Proposed resolution

Make paragraphs appear with some wrapping.

Image + Text and Text + Image should be 50/50 or similar.
Images (unlimited) should be multiple per line.

Remaining tasks

User interface changes

API changes

Comments

pivica’s picture

Status: Active » Needs review
StatusFileSize
new344.7 KB
new270.32 KB
new20.68 KB

OK here is a first patch for this, next stuff is done

  • updated configurations a bit to have better default values for labels and added paragraph text type
  • added new css in demo module

Attaching screenshot how stuff looks now (node edit and node view)

node edit
paragraphs edit

node view
paragraphs edit

Maybe for the future we could add next things (not sure is there a real value or is it just waste of time):

  • We could add aditional field for image/text combination - select box with next values: 1/4, 1/2, 2/2, 2/1, 3/1, 1/1 and then add appropriate classes for it.
  • Also we could add field with standard grids rendering of images paragraph - editor could select how many items per row it wants - so we have some kind of a simple grid support
miro_dietiker’s picture

Oh that's really nice. Just small things unclear to me.

+++ b/modules/paragraphs_demo/paragraphs_demo.libraries.yml
@@ -0,0 +1,5 @@
+  version: VERSION

VERSION?

Additionally, i'm a little bit confused about all the proposed config changes. Is an updated core leading to different export sequence or anything else?
In general, dropping "demo" in field labels makes sense.
Can you elaborate the changes a bit more? Or possibly i should review the demo setup after installation.

This issue is not about configurability. It's about lowering the barriers to make a possible user understand the paragraphs concept. Note also that tools like display suite and friends can be used with Paragraphs.
Your suggestions about configurable layout are unclear to me. Please create separate issues so we can discuss the ideas and exchange mockups there if needed.

pivica’s picture

StatusFileSize
new20.68 KB
new400 bytes
+++ b/modules/paragraphs_demo/paragraphs_demo.libraries.yml
@@ -0,0 +1,5 @@
+  version: VERSION

Yeah copy&paste error, changed it to version: 1.0

In config files 4 things are changed:

  • Removed 'demo' from labels
  • All field labels on display are hidden
  • Added 'paragraph text' paragraph type
  • Use core image styles for image displays

The rest of the stuff just came from config export - I guess because of various changes in core export.

Your suggestions about configurable layout are unclear to me. Please create separate issues so we can discuss the ideas and exchange mockups there if needed.

Its not really full configurable layout, simple idea we have one additional select box field for image/text combination with some values like: 25/75, 33/66, 50/50, 66/33, 75/25, 100/100. Then when displaying paragraph we inject value from that select box as a css class, for example paragraph-layout-25-70 and then show image with 25% width and text with 75%.
Similar for images - but it would be probably more complex for rendering because we probably need then row wrappers.

Still I don't think that this should go to paragraph_demo, this would then be paragraph_layouts, and current css from paragraph_demo would be 50/50 for image/text combination.

Note also that tools like display suite and friends can be used with Paragraphs.

Yeah we could also create templates/css for display suite. More over it seems that layout plugin will maybe go into 8.1.x core version #2296423: Implement layout plugin type in core, so i guess it has more sense to create templates based on layout_plugin module and not provide our custom solution. Our paragprah_demo would then also use this layouts and would not ship with custom css.

Here is a separate issue where we can discuss further this idea #2449347: Can we use layout_plugin module to provide different templates for paragraphs.

Attaching new patch - just version string fix.

pivica’s picture

And just did full reinstall of drupal and paragraphs_demo, everything looks OK and works as expected from my side.

miro_dietiker’s picture

Configurability of the aspects contains a mismatch in that different ratios need different screen sizes that are usually configured per display mode.
We would need to reconfigure image styles per layout chosen..?

Demo should show the power of the module. So in case there is an awesome layout concept that well fits the paragraphs vision, we also should ship a demo variant.

pivica’s picture

If I remember correctly in D8 there is breakpoint support for image styles with responsive_image core module - are you talking about this? So I guess we do not need to worry about this in paragraphs layout it is a separate thing which should already be supported.

Thinking a bit more about repsonsivnes our paragraph layout should also be repsonsive somehow, not sure how to approach this for now, adding note to #2449347-1: Can we use layout_plugin module to provide different templates for paragraphs.

miro_dietiker’s picture

Status: Needs review » Reviewed & tested by the community

Tested it through the UI. Verry nice work. A perfect start to show the functionality for quick demos or even presentations.

Just...
# drush en -y paragraphs_demo
And then let's *rock*!

jeroen.b’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, looks great! Committed to dev.

  • jeroen.b committed fe3bc44 on 8.x-1.x authored by pivica
    Issue #2445077 by pivica: Provide CSS for demo module
    
miro_dietiker’s picture

Component: User interface » Demo

Moving to demo component.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jhmnieuwenhuis’s picture

Component: Demo » Code

This works for Bartik theme, but not for Bootstrap theme.

Can not seem to find the issue, any ideas?

Regards,

Hans