Using the Wysiwyg module, we are able to add an image. Is there any way so that I am able to view my blocks in it as well as assign those blocks in any place inside a page?

  • 3
    Insert Block looks interesting and does exactly that, though it's only in dev. There's also this sandbox module which does the same thing, so it's definitely possible. For the former you'd have to implement the button yourself and link it up to the replacement token; for the latter, it looks like that's even taken care of for you – Clive May 20 '13 at 12:55
  • 1
    If you think about it the process is actually pretty straight forward - writing a WYSIWYG plugin is trivial, and all you'd need is to implement an AJAX callback to provide a choice of blocks to insert. These would be 'inserted' in the form of a token string, and a custom filter would be written to detect those strings and replace them with the block after gathering metadata from the string. Simples :) – Clive May 20 '13 at 13:11

Seems you will need to write your own plugin. There are dozens of manuals, like Creating a CKEditor Plugin with a Custom Dialog Window - this one seems to be good for you, as you might want to have dialog window to allow user select a block.

You will need tips from this Drupal.org thread to

Don't forget to consider security issues when deciding who should be able to add what.

Last but not least, publish your module on Drupal.org for future developers.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.