Hi,
As suggested here: http://drupal.org/node/1843404#comment-7136780 I would very much like to be able to have a email friendly panels layout for simplenews.
This way I can make with simplenews a nice newsletter with different nodes/entities on different panel-panes with a great layout-system.

Thanks a lot in advance for considering this!
Greetings, Martijn

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andrewbelcher’s picture

Cool, I'm happy to build the layouts, the two questions are:

1) What layouts do we want, i.e. one col, two col etc. @Summit, would you be up for putting a starting list together for this?

2) @berdir: are you happy for this to go into simplenews? As it all works off of ctools_plugins, it doesn't add any load weight to simplenews, just a few more files. Alternatively this could go in a separate module if you don't want it in simplenews, in which case I'll create a sandbox for it and move this issue there!

Berdir’s picture

Sounds like a useful feature to me.

andrewbelcher’s picture

Excellent, once Summit has put together a started list I'll start getting some patches together for it!

Summit’s picture

Hi,

Wouldn't it be great for starting to mimic the standard panels layouts (with exception of the flexible):
http://weboxy.files.wordpress.com/2010/12/drupal-panels1.gif
and may be adding some of the http://drupal.org/project/panels_extra_layouts layouts?

With this the newsletter can exactly look as a webpage of the site using panels!

Greetings,
Martijn

Summit’s picture

Hi,
Is this information ok for a starting list as asked for?
Greetings, Martijn

andrewbelcher’s picture

Sorry, yes, it is. I haven't found the time to do it yet. A client will need it fairly soon, but they have other priorities at this moment in time. So they will come but it may be a couple weeks...

Berdir’s picture

My suggestion would be to start with a single template to show how it works. Someone less experienced could then easily add additional ones.

andrewbelcher’s picture

Here is a patch which introduces all of the panels layouts in email friendly tables!

Due to the flexible layout builder not being using tables I've made the layouts a little bit more flexible... All the sidebars in the three column layouts will automatically collapse with the middle region expanding. Also, the two col bricked layout will hide sections that are empty.

I hope the patch has generated properly, had to google how to deal with binary files in a patch but it applies cleanly for me, so I think it's ok!

andrewbelcher’s picture

Status: Active » Needs review

Forgot to change the status...

Berdir’s picture

+++ b/plugins/layouts/email_onecol/email_onecol.incundefined
@@ -0,0 +1,13 @@
+/**
+ * implementation of hook_panels_layouts()
+ */
+// Plugin definition

The implementation of docblock isn't necessary I think, this is not a function/hook. The comment below should have a . at the end (same for the other plugins).

Happy to commit this after someone tests them and can confirm that it works.

Summit’s picture

Hi, I can't get the patch to work, my mistakes with manually testing, can you maybe add a winzip with this patch in? Then I can test coming week.
Otherwise, somebody else has to do it.
Thanks.
Greetings, Martijn

andrewbelcher’s picture

Berdir - The comments were copy pasted from Panels... But I'll tidy them up and put up another patch!

andrewbelcher’s picture

Berdir - here is an update patch. I've ditched commenting the $plugin itself and opted for an @file comment which I think makes more sense.

Summit - I've added a zip of the entire module but if there were issues with the patch applying we probably need to resolve them, what went wrong?

Status: Needs review » Needs work

The last submitted patch, 1933822-13-add_email_friendly_panels_layouts.patch, failed testing.

andrewbelcher’s picture

Status: Needs work » Needs review

Ok, I'm not sure how my patch caused that test to fail... I don't touch anything in the administration, gonna try re-testing to see if it was a freak!

andrewbelcher’s picture

Summit’s picture

Hi @Andrewbelcher, I do not have patching tools thats why I asked the zip, the patch seemed a lot of copy-pasting otherwise.
Thanks for sharing it, and I will see if I can test it.
greetings, Martijn

Summit’s picture

Hi,
I think somewhere here must be the answer: http://drupal.org/node/1843404#comment-6936804 but how can I test simplenews using panels-layout for newsletter please? Can you explain on which /admin pages I have to do what?

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

andrewbelcher’s picture

Summit - you need Panelizer (7.x-3.x) and you can the 'panelize' the newsletter content type's html email view mode allowing you to use panels to lay out your email.

rlmumford’s picture

Looks good from a code point of view

Summit’s picture

I got

Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 's.tid' in 'field list': INSERT INTO {field_data_simplenews_newsletter} (entity_id, revision_id, bundle, simplenews_newsletter_target_id, entity_type, language, delta) SELECT n.nid AS nid, n.vid AS vid, n.type AS type, s.tid AS tid, :entity_type AS entity_type, :language AS language, :delta AS delta FROM {simplenews_newsletter_old} s INNER JOIN {node} n ON n.nid = s.nid; Array ( [:entity_type] => node [:language] => und [:delta] => 0 ) in simplenews_update_7201() (regel 1015 van sites/all/modules/simplenews/simplenews.install)

while installing the zipped module. First I had to remove simplenews_newsletter_old because of this report:

DatabaseSchemaObjectExistsException: Kan tabel <em class="placeholder">simplenews_newsletter</em> niet hernoemen naar <em class="placeholder">simplenews_newsletter_old</em> omdat tabel <em class="placeholder">simplenews_newsletter_old</em> al bestaat. in DatabaseSchema_mysql->renameTable() (regel 307 van /var/www/vhosts/opstellingennetwerk.nl/httpdocs/includes/database/mysql/schema.inc

Edit: because I am just experiementing with simplenews, I disabled the whole suite of simplenews modules and enabled them again. Now no errors anymore.
Somehow something with simplenews_newsletter_old is not going right I think.

Greetings, Martijn

Summit’s picture

Hi,
because I am just experiementing with simplenews, I disabled the whole suite of simplenews modules and enabled them again. Now no errors anymore.

@Andrewbelcher. I am on admin/config/content/panelizer
1) I enabled Simplenews Newsletter for panelizer
2) I enabled Email: HTML for panelizer. Enabled everything on the row so I got "Save to access panel list"
3) I clicked save

After this the options to enable panelizer where not shown anymore for email, only
Full page override
Standaard
Teaser

How to proceed to see the html email view mode please? I didn't see a viewmode under admin/config/system/htmlmail

Thanks a lot in advance for helping me.
Greetings, Martijn

Summit’s picture

Hi,

4) I had to go to the simplenews contenttype and on admin/structure/types/manage/simplenews/display
Add as adjusted display Email: HTML
After this on admin/config/content/panelizer I saw Email: HTML arising.

But How to get different nodes now on different panel-pane places, so that on the newspaper email it looks like a panel page with the content orderly?
Please advise.

Thanks a lot in advance.
greetings, Martijn

andrewbelcher’s picture

Summit, I think it looks like your questions are more support requests for using panelizer and simplenews together. Would you mind starting a new issue for it so we can try and keep this one clean for the layout patch?

Summit’s picture

Status: Reviewed & tested by the community » Needs review

Hi,
Yes I thought so already, will start new issue, thanks for suggestion.
EDIT: made this issue: http://drupal.org/node/1953744
greetings, Martijn

rlmumford’s picture

Status: Needs review » Reviewed & tested by the community

Installed and tested and everything seems to work :)

Status: Needs review » Reviewed & tested by the community
rlmumford’s picture

Issue summary: View changes

Any chance of this being committed? It's been RTBC for a year.

endemic’s picture

@rlmumford. You can easily use the power of a panel by using a panel node (content type panel node) and a node reference to this panel node inside your simplenews content type.
By using this technique you can create complex newsletter containing nodes, blocks or views displays.

yanniboi’s picture

To reiterate what @rlmumford said, any chance of getting this committed?