- 🇮🇳India santhosh@21
The same issue I got when using Layout Paragraphs and Paragraphs module as the preprocess paragraph is changing the default id values to "pargraph-id" and it is affecting the Layout Paragraphs and losing the editing controls of layout paragraphs.
The below code fixed the issue for Layout editing
Also Attached the patch for someone who is looking for
function ptoc_preprocess_paragraph(&$variables) { // Check if the ID attribute is already set. if (!isset($variables['attributes']['id'])) { // Generate a new ID only for paragraphs in the default view mode. if ('default' == $variables['elements']['#view_mode']) { $variables['attributes']['id'] = 'paragraph-' . $variables['paragraph']->id(); } } if (Drupal::config('ptoc.settings')->get('debug')) { $variables['attributes']['class'][] = 'ptoc-debug'; $variables['#attached']['library'][] = 'ptoc/ptoc-debug'; } }
- Status changed to Needs review
7 months ago 10:42am 31 May 2024 - Status changed to RTBC
3 months ago 5:17pm 11 September 2024 - 🇮🇳India rifas-ali-pbi Kerala
I have tested this patch. After applying this patch now Paragraph is working fine.