CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • New Drupal Module - Add Drupal Content to CiviMail
Pages: [1] 2

Author Topic: New Drupal Module - Add Drupal Content to CiviMail  (Read 12037 times)

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
New Drupal Module - Add Drupal Content to CiviMail
July 08, 2009, 11:15:57 am
Hi there, thought I'd bring to your attention a new module developed to add Drupal content to your CiviMail posts. Should you have any questions please don't hesitate to ask and any developments are welcomed! Please credit Consult and Design International where possible.

http://wiki.civicrm.org/confluence/display/CRMDOC/Add+Drupal+content+to+CiviMail

Thanks,

Adam

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: New Drupal Module - Add Drupal Content to CiviMail
July 08, 2009, 11:23:58 am
Adam - this seems very cool. How about posting a quick blog on civicrm.org to let more folks know about it! You can post one from:

http://civicrm.org/blog/6512
Protect your investment in CiviCRM by  becoming a Member!

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: New Drupal Module - Add Drupal Content to CiviMail
July 08, 2009, 03:55:06 pm
Adam,

Looks interesting.  Couldn't find the module on d.o projects.  Have you created a project page?  Is it version controlled?  Any tests to include with it (simpletest, phpunit, etc.)?

If you want people to contribute, offer feedback, suggestions, patches it would be best to get it into d.o. or somewhere with an issue tracker and a repository where you can manage revisions.

A quick glance at the readme... it would seem there are a couple of areas to improve portability:

1. Instruct people to create a custom template instead of hacking core:
http://wiki.civicrm.org/confluence/display/CRMDOC/Directories

2. Don't tell people to install templcrm into modules/.  All contrib modules go in sites/all/modules.
3. Don't hardcode the path to templcrm.tpl.  Couldn't it just be copied into or included from the custom template above?
http://dharmatech.org
oss@dharmatech.org
801.541.8671

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: New Drupal Module - Add Drupal Content to CiviMail
July 09, 2009, 07:58:16 am
Hi Adam,

Great that you have published this.  +1 for Dave's suggestion of copying that post to the blog where it'll receive much more attention - it's a cool module.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: New Drupal Module - Add Drupal Content to CiviMail
July 10, 2009, 02:03:40 am
Hi guys! Thanks for the comments... I'm running like a crazy man to London then off to Lativa (hm... deja vu?) but just on your points:

1) I'll try and post a blog asap - lobo gave me permissions - thanks dave!
2) Dharma - there is no drupal page at yet, mainly for all the reasons you gave. Our major problem right now is time, and the ability to support/maintain the module in any way. I'm not the dev, and our dev is up to his eyeballs right now. I've just thrown it out there for people at the moment - maybe in a month or two we could set something up but this summer is very busy for us.

I'm happy for someone else to take over maintenance (even at this stage if it increases features/stability etc.).

See what take-up is like but I guess we keep this post as the place for people to feedback/post any patches etc. But I'm new to this so feel free to guide me in anyway you think is best!

Thanks,

Adam

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: New Drupal Module - Add Drupal Content to CiviMail
July 13, 2009, 08:09:55 am
Hi all,

This was a response I got from Piyush, who was also on the camp and requested a copy of the module through e-mail. It has some important information and it sounds like Piyush is working on this so I will try to direct him here as a space to keep the development moving.

Given the comments so far, I'm feeling that our original "Concept" needs quite a lot of work! It would be great if this is done collaboratively :)

Anyway here is the response from Piyush:

Quote
I spent most of yesterday getting it to work on a local development install and just about managed it.

I've noticed that most of it isn't very Drupal 'friendly' - it uses direct mysql database queries and functions, etc.

It however looks to be a great utility to use within CiviMail and definitely something I can use for one of my clients.

So I plan to start getting my hands dirty and learning how to code a Drupal module properly (finally!) as I would like this to be a good generic solution that others can use too.

Not sure how long this will take but will keep in you touch as to how it's going and will send you back the code. If you're happy releasing this into the community, we should eventually figure out where the module can be uploaded to. Don't think CiviCRM has a module/code repository for contributed modules yet but that would be ideal as it is specific to CiviCRM users. Otherwise I guess we can try and get it into the Drupal contrib cvs. We should also think of a better name for the module.

By the way - My idea for the name would be something like "CiviMail Insert Content" (bit long... but I prefer descriptive names!)

Thanks All!

Adam

Piyush

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
    • Pecan Solutions
Re: New Drupal Module - Add Drupal Content to CiviMail
July 13, 2009, 09:12:34 am
Hi all,

Adam just emailed me and said there he had started a new thread discussing this module.

I started looking at this a couple of days ago and already started to clean it up by removing the direct mysql queries and moving some functions that were in a separate php script into the module file. The module now also installs in the sites/all/modules directory like other contrib modules.

However, after doing all that, I wondered if there was already a Drupal module that would allow inserting existing node content into the editor. I found http://drupal.org/project/InsertNode, which uses an input filter tag to pull in node content, and also http://drupal.org/project/linktocontent which (with a editor plugin) allows inserting a link from a list of nodes (configurable options for this search).

So I've just spent a few hours today seeing if maybe the linktocontent together with the linktonode fckeditor plugin would be a better way to this functionality. The fckeditor plugin seems to work fine for inserting links and I'm trying to understand how to modify it to bring in the node teaser or body instead. Beginning to think that if you use fckeditor/tinymce as your wysiwig editor, this is a much nicer way of pulling in content into the Civimail editor window. I haven't yet tested this within the Civimail message editor.

Has anyone come across / used any other modules that allow node content insertion into the editor?

Will keep you posted on what I find.


adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: New Drupal Module - Add Drupal Content to CiviMail
July 15, 2009, 04:13:02 am
Thanks for the update Piyush! I had used the insertnode module before but felt for this is was too rudimentary, however I didn't try the linktocontent which sounds very interesting. If it can do what our module was trying to do it would be great - let us know how you get on.

In the meantime is there any chance you could send your updated/cleaned up version of the module through so I can use it as an example with our developer :) He's totally new to Drupal hence the not so nice coding practices - it would be great if he could see what you did to learn for next time / future developments.

I will also then share the module with the community via a post on the blog - I think its better with a cleaned up version :)

Let us know how you get on. Many thanks!

Adam

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: New Drupal Module - Add Drupal Content to CiviMail
July 21, 2009, 08:52:15 am
Hi Piyush,

Did you get any further on this? If you have the work you did on the module it would be great - on Thursday we will begin some more developments and your cleaning would sure help! Could also teach our dev a thing or two :) I'll post more details of what we get after thursday but hoping to implement the permissions at the very least.

Adam

Piyush

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
    • Pecan Solutions
Re: New Drupal Module - Add Drupal Content to CiviMail
July 22, 2009, 07:57:12 am
Hey Adam,

As I said earlier I only started cleaning this up when you first sent it to me and as I'm still learning how to write Drupal modules, watch out for code not up to spec! You can download the modified module (which I've renamed to civimail_insertnode - hope you don't mind) at http://www.pecansolutions.com/sites/default/files/code/civimail_insertnode.zip.

However, instead of using this module, I found that using the linktocontent_node module from the dev version of linktocontent for fckeditor (at http://drupal.org/node/252938#comment-1588106) together with the linktonode fckeditor plugin from the fckeditor 6.x-2.0-beta1 release (at http://drupal.org/node/407376) with a few changes works just as well as having a custom module to insert node content for CiviMail, and also then allows inserting content into any fckeditor instance.

I used Chris Ivens' notes at http://civicrm.org/node/556 to let CiviCRM use the same fckeditor as installed in the Drupal site. This now allows the linktonode fckeditor plugin to work in all fckeditor windows i.e. both on Drupal nodes and on the CiviMail message editor page.

As I was running out of time, I changed the _linktocontent_node_get_nodes() function in the linktocontent_node.module to bring in the node teaser. I also changed the _addNodeToList() function in the linktonode fckeditor plugin functions.js file and also the Ok() function in the utils.js file. I also added some css to hide the teaser column in the linktonode plugin popup window.

I'm unfortunately not yet that good with javascript and Ajax – it would be better to get the node teaser value using a getdata() type callback function rather than fetching all the teasers in the first query as I currently do in the linktocontent_node module.  It would also be a good idea to create a separate contrib module for the linktocontent set of modules so that the original linktocontent_node module does not need to be modified.

Also it would be great to modify the linktonode fckeditor plugin to have some radio button options to choose between inserting a link to the node (which is the original intention of this plugin and already works), the node teaser or the full node body. This would then make this plugin really useful and flexible not just for CiviMail but for inserting any node content into any editor window. Maybe someone who understands this better can help get this plugin to this level of functionality.

fearlsgroove

  • I’m new here
  • *
  • Posts: 25
  • Karma: 2
Re: New Drupal Module - Add Drupal Content to CiviMail
July 31, 2009, 08:16:10 am
I'm interested in working on this too. Based on the interest, it would be great to make this available somewhere in source control. Can we set up a drupal project for this? I'll be happy to help with that if someone can make available working code with many of the cleanup work mentioned in this form complete.

Also related, and IMO even more powerful than node insertion, would be inserting views:
http://drupal.org/project/insert_view

I like the approach of using Drupal's WYSIWYG in lieu of Civi's WYSIWYG, particularly as a way to leverage drupal input filters to process the content.

stevecowie

  • Guest
Re: New Drupal Module - Add Drupal Content to CiviMail
September 06, 2009, 03:41:41 am
Hi
I finally started taking a look at this after meeting Adam at the developer camp in London earlier this year. My first thought is to use a token approach in combination with Drupal relatedcontent module. That module allows you to associate one or more views with a particular content type so you can then manually select which nodes to include as related content. Using this in combination with a token in civimail, you could insert one token and that would be job done.

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: New Drupal Module - Add Drupal Content to CiviMail
September 07, 2009, 05:57:01 am
Hi all,

I think there are a number of objectives here that people have different :) To be clear on our use case, it was as follows:

To provide a simple point-and-click interface to the CiviMail system to include drupal site content of multiple types

While Views integration would be magic in certain use cases, I don't think for our needs it is necessary. Our experience is that Views is more of an "admin" user interface and too powerful for the general office based CRM user. In this sense I'm not sure we can help much with this with our current contract. If I understand how it could be mixed/integrated with the above I could be persuaded!

I talked this through with Piyush briefly at DrupalCon in Paris and while his methods are working, our stumbling block was with the multiple node types - however with some work he felt this could be achieved. I completely agree that working with existing modules is useful - however only if this has the support of the maintainer, otherwise its just another "fork" and has no major use.

Maybe we can combine thoughts on what we are trying to achieve? I think its all similar, and all useful, but the question would be whether we're working on one module, one module with multiple uses, or seperate modules.

Thanks,

Adam


petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: New Drupal Module - Add Drupal Content to CiviMail
February 15, 2010, 01:35:09 pm
Shame to let some good ideas like the above go quiet - so thought I would poke to see if other progress or ideas or problems could be fed back in to the community
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

adshill

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 8
Re: New Drupal Module - Add Drupal Content to CiviMail
February 16, 2010, 03:44:58 am
Hi Peter,

We still have the original version of the module (as posted above) working on a 2.7 install quite happily, although the image support isn't great. We would love to invest more into making this better as I'm aware the code isn't very gracious at all, however we just don't have the need for it right now. If we got some investment, I'm still not sure would be the best way to progress this! What are your thoughts?

All the best,

Adam

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • New Drupal Module - Add Drupal Content to CiviMail

This forum was archived on 2017-11-26.