Jump to content

Hanna Code


ryan

Recommended Posts

On 7/27/2024 at 5:30 AM, MarkE said:

I have a site with a large number of Hanna codes which I want to use on another site. How can I do this without manually exporting and importing each one?

You can use Ryan's ProcessDatabaseBackups module to do this.

Export:

image.png.e647b943b4f005ab5e5a730bb05a95f7.png

Import:

image.png.fdce12f3c9321613dc1b98221cc0fb50.png

Without ProcessDatabaseBackups you could use PhpMyAdmin or Adminer to do something similar.

If your Hanna codes reference external files (I prefer to use files for my Hanna codes so I can edit them in my IDE) then you would need to copy those to the other site too.

  • Like 1
Link to comment
Share on other sites

10 minutes ago, Robin S said:

You can use Ryan's ProcessDatabaseBackups module to do this.

Aha! Always something more to learn... I use that module a lot, but never explored individual tables. I guess it's fine where the tables are 'stand-alone' as in this case, but otherwise it might get a bit scary.

No matter, the module was quite quick and fun to write and hopefully carries less risk of screwing up the database ?

EDIT: Plus I can integrate it into my migrations module if I want to.

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

Is it possible to make a hanna code tag that spans multiple lines?  For example ..

[[ my-hanna-tag
    var1=value1
    var2=value2
    var3=value3
]]

I'm not seeing the code that is causing the CRs to break the parser.  Ideas?

OK, I got it working by adding a quick hack to TextFormatterHannaCode.module, in function formatValue(), add

$value = preg_replace('/\n+/', ' ', $value);

 

Edited by The Upright Man
Got it
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...