The current set-up for linking content to a campaign (using macros and the 'Mailchimp campaign' Input format) is great, and seems to work well.

Initially, while using it I found that I had problems producing good output.

I make use of an admin theme in addition to my site's main (client facing) theme. When the content is built for insertion into a campaign, the default node.tpl.php template files are used from my admin theme, rather than my site's main theme.

This is partly good, because it means I can define a different set of templates for newsletter content - but ideally I think there should be a specific set of phptemplate files available from each site's main theme.



Does this already exist, and if not could be added as a feature?


Rob_Feature’s picture

Status:Active» Closed (duplicate)

This is really due to the lack of theme functions (which is the first step to template files), which is in #936504: Add theme functions. Marking this as a duplicate of that one.

e0ipso’s picture

Title:Provide specific mailchimp--<node>.tpl.php files» Select theme to render entity macros
Status:Closed (duplicate)» Active

I think the important point here is that entities are turned into HTML using the current theme. Given that campaigns are added in admin/config/services/mailchimp/campaign/add Drupal renders them using admin theme.

HTML Mail module, and others, allow you to select the theme you want to use. This is specially relevant for campaign creation.

If we do that then the selecion of the template is based on the current rules. You could create a view mode for each desired visual representation of the entity and add a theme suggestion to select a custom template (maybe to use tables for complex layouts). You might also use Display Suite for the last part.

basvredeling’s picture

Version:7.x-2.x-dev» 7.x-3.1
Issue summary:View changes

This is still an issue in 3.1... The default use case as described is that nodes inserted with an entity lookup are rendered with the admin theme. I'd reckon there are few use cases where you send a news letter to subscribers rendering content in an admin theme. Only a newsletter sent to site admins (who have permission to view the admin theme) would match this use case.
So we should use the default theme instead or add an extra option to select the theme during generation of the insert content token.