I added a variant to my panels node template to override the display of my newsletter layout. But it does not appear to work. This would be nice and make configuring newsletter content a lot easier. Apart from that we get a lot for free such as per pane caching and so on. What is needed to make this work?

CommentFileSizeAuthor
#16 email.png2.87 KBandrewbelcher
#16 email.inc296 bytesandrewbelcher
#16 email.tpl.php578 bytesandrewbelcher

Comments

miro_dietiker’s picture

Is it a panel node?

Basically we rely on node_view to render the node content.
If panel will take over the node rendering process that way, we're fine already.

Other rendering cases need a few custom lines to trigger. Search for the node_view calls and learn what's happening there.
The pane caching won't help too much without custom plugins to cover the newsletter cases for personalized newsletters. Note that for non-user subscribers the context is the (user) anonymous page caching.

miro_dietiker’s picture

Status: Active » Postponed (maintainer needs more info)
luksak’s picture

Category: feature » bug
Status: Postponed (maintainer needs more info) » Fixed

I had the selection rules configured wrong due to a variant clone... I have this issue so often that maybe I should code something that always redirects me to the selection rules when cloning a variant. I am sorry for the false alarm.

Other rendering cases need a few custom lines to trigger. Search for the node_view calls and learn what's happening there.
The pane caching won't help too much without custom plugins to cover the newsletter cases for personalized newsletters. Note that for non-user subscribers the context is the (user) anonymous page caching.

Well, pane caching can become particularly useful when sending to users where you have a part that is not personalized.

miro_dietiker’s picture

Category: bug » support

Thank you for the update.

luksak’s picture

Status: Fixed » Active

The node is still not being displayed by panels. I am using ctools dev and panels_everywhere. May one of those be the problem?

miro_dietiker’s picture

Category: support » feature

In that case it's again a feature request (that is not on our roadmap yet). So we're happy to include it with your patch.

Since panels everywhere modifies the global page rendering with elements from the content context, i expect it to be incompatible with our rendering strategy.

We only render the node content part and don't trigger the global rendering mechanism. Instead we replace the page rendering with a custom rendering process, introducing header and footer.

For your requested support, we would need to switch to a separate newsletter theme that provides a separate page.tpl.php and html.tpl.php and so on...
Then, we would not only trigger node_view, but the global page rendering with the node context.
I would expect that panels everywhere then would just do hat you expect.

Alternatively, we can introduce additional file suggestions in preprocess functions...
http://api.drupal.org/api/drupal/includes%21theme.inc/function/template_...
http://api.drupal.org/api/drupal/includes%21theme.inc/function/template_...
and stay with the regular rendering. A theme can then introduce newsletter specific variants of the design.
I expect we would drop the current footer concept then and place it with a different rendering mechanism (such as a block or into the page render array / page preprocess)

Finally to tell: i would love to see an initiative that introduces mime mail support that defines a standard that most themes adapt and additionally to the browser theme provide a mail theme that is fancy and well tested.
(Also note that most mechanisms like floating with modern div based layouts instead of tables don't work with most mail clients.)

Looking forward to your improvements.

luksak’s picture

Your first approach sounds like a bigger task... Which of both is the cleaner approach in your opinion?

The problem is that I got the newsletter working without panels and I don't need this feature desperately. But if it is not too hard I'd give it a try.

We had the discussion about joining forces for one solid mime mail system at #1122910: Compare HTML Mail with Mime Mail. I did not have the time to check out htmlmail again.

muschpusch’s picture

I think this get's even more interesting in combination with: McHammer

rlmumford’s picture

I think this is already done with the latest version of Panelizer (7.x-3.x-rc1).

muschpusch’s picture

rlmumford: hm? Please explain a bit more!

andrewbelcher’s picture

With the new version of Panelizer (3.x) they allow you to create Panelizer settings for each display mode of any entity (node or otherwise). Since Simplenews uses a display mode for the way a node is rendered, you can use Panelizer to build that display mode, therefore allowing you to use Panelizer to build your templates.

However, the caveat on that is that there is currently a bug I found in Panelizer (#1833826: Allow all view modes to be customized) that stops this from actually working as the Simplenews email view modes are disabled by default. Once that is fixed, which I'm hoping to have time to write a patch for, it will work!

I imagine it'll be tricky to use Panels (ie page manager/tasks) to compose emails, as it uses the menu system for it, rather than hooking in at the build phase, which is what the new Panelizer does. So my suggestion would be not to put effort into making Simplenews support Panels, but to wait until Panelizer fixes the bug or even post to the issue there to help speed that one up!

summit’s picture

Hi, the post http://drupal.org/node/1833826 seems solved. Does anybody have a solution to use panels-panes to build the newspaper?
It would be great to be able to set one node left, the other one right etc...

Thanks a lot in advance for your reply!
Greetings, Martijn

andrewbelcher’s picture

Yes, that is now fixed. #1914138: Unsettings $build['#theme'] prevents you theming or using panelizer is the only thing blocking it now. I think there has been a proposed solution to that, so I'll take a look later and see if I can get a patch up for it. Once that is resolved, it is a really simple case of panelizing the correct view mode and you're good.

One thing to note; email clients don't tend to have very good css support resulting in the need to use tables for layouts in emails. That means you'll need to create your layouts with tables rather than using the stock layouts/layout builder as they all use web oriented divs.

A panelizer submodule to simplenews that provides various table base layouts may be a good way to go if there is enough demand for it...

summit’s picture

Hi,
Would love to see a simplenews-panelizer submodule with tableformat.
I am volunteering to test such a submodule. I think this would be a great add-on because the layout of the newsletter can than be ultimate controlled.

Thanks a lot in advance for considering building such submodule!
Greetings,
Martijn

andrewbelcher’s picture

Category: feature » support
Status: Active » Fixed

There is now a patch in the related issue which hopefully will be able to go in soon and I've attached an example panels layout which you can use to see how to do it.

If you want some email friendly panels layouts to be packaged with simplenews I would suggest you create a new issue for it.

andrewbelcher’s picture

StatusFileSize
new578 bytes
new296 bytes
new2.87 KB

Sorry, here are the examples... The php files have a .txt extension that is just there so they can be uploaded.

summit’s picture

Hi,

As suggested I made a new issue for email friendly panels layouts to be packaged with simplenews.
http://drupal.org/node/1933822. Thanks a lot in advance!

Greetings, Martijn

Status: Fixed » Closed (fixed)

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