Let's say I have created a block with some Full HTML (Facebook Feed) text inside. How can I commit the block and its text content into my Git repository, so my co-workers can pull it?

  • how is this question related to Drupal? – Aboodred1 May 21 '13 at 13:09
  • Because the block is in Drupal?! Or what do you try to suggest? – leymannx May 21 '13 at 13:11
  • Drupal blocks store its html/text into database, why you need git for? – Aboodred1 May 21 '13 at 13:12
  • 8
    @Aboodred1 This is definitely a Drupal issue (a pretty common one actually). There's an entire Drupal 8 initiative dedicated to solving the general problem of config management. This is about as relevant as it gets :) – Clive May 21 '13 at 13:16
  • 2
    Storage engine is irrelevant - "how to export * from Drupal?" for me is definitely a Drupal question. – Mołot May 21 '13 at 13:17

Turn it into a Feature. Bad thing is, it does not work on built-in custom blocks, so you need to use Boxes to get it work.

That way, you can export block as a module, and modules are text files, so GIT accepts them with it's full support.

Then, there is Features to Git module. It claims:

Features to Git allows trusted users to write features directly to disk, commit them to git and push them to a remote. This makes it possible for site builders to be able to manage features in git without having to get their hands dirty on the command line.

  • +1 for using Boxes-- this works, although from my experience it's a bit of a pain (e.g., if you need translations, you also have to add i18n boxes module). – Patrick Kenny May 21 '13 at 13:33
  • 1
    Everything have it's ups and downs. Built-in blocks needs Block languages module too! I don't claim boxes are easy. I'm not going to claim my answer is best. But from my experience it is an answer (except the Features to Git, it's from Google, not experience). – Mołot May 21 '13 at 13:48
  • Uhhh Thank you very much!!! That worked like a charm!!! 1. I installed and activated Boxes 2. I created a Box (Structure >> Blocks >> Add Box) and inserted my HTML text (plus set the text format to Full HTML) 3. I created a Feature with the module and the box inside (worked like a charm, box appeared immediately) 4. pushed it into the repo and that's it My co-worker pulled it, acivated it and put everything in the right place again. – leymannx May 21 '13 at 14:49

Create a module for that block using the Features module and then commit that module on to the GIT repository of yours.

For more information you could read the README.txt of feature module from.

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.