Insert Site content token function does not use correct drupal templates

Created on 19 October 2016, over 8 years ago
Updated 8 October 2024, 6 months ago

Hello,

I defined some drupal templates for my content type "Newsletter" and they are working fine when viewing the node.
But when i embed the node inside my mailchimp campaign via "Insert site content" into one of my mailchimp template block, the templates are not found and default templates are used.

For example in my campaign i added the shortcut :

[mailchimp_campaign|entity_type=node|entity_id=48787|view_mode=full]

Theme Hook shown in my global outer template for my newsletter node rendered as "full" outside of mailchimp is :

<!-- FILE NAME SUGGESTIONS:
   * ds-1col--node--48787.html.twig
   x ds-1col--node-newsletter-full.html.twig
   * ds-1col--node-newsletter.html.twig
   * ds-1col--node-full.html.twig
   * ds-1col--node.html.twig
   * ds-1col.html.twig
-->
<!-- BEGIN OUTPUT from 'themes/fms_theme/templates/ds-1col--node-newsletter-full.html.twig' -->

But the same node rendered via the mailchimp campaign (as sent to mailchimp) is :

<!-- FILE NAME SUGGESTIONS:
   * ds-1col--node--48787.html.twig
   * ds-1col--node-newsletter-full.html.twig
   * ds-1col--node-newsletter.html.twig
   * ds-1col--node-full.html.twig
   * ds-1col--node.html.twig
   x ds-1col.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/ds/templates/ds-1col.html.twig' -->

As you can see my template ds-1col--node-newsletter-full.html.twig is suggested but not used and the default template is used instead.

Any idea why ?

Thanks a lot.

πŸ› Bug report
Status

Active

Version

1.0

Component

General

Created by

πŸ‡«πŸ‡·France gavrochelegnou

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States pookmish

    By changing the edit form to not use the admin theme, it is possible to use the default theme instead of the admin theme. This can be done by altering the existing route β†’ .

      protected function alterRoutes(RouteCollection $collection): void {
        if ($route = $collection->get('entity.mailchimp_campaign.edit_form')) {
          $route->setOption('_admin_route', FALSE);
        }
      }
Production build 0.71.5 2024