Web based family history software

Question New block

  • samark
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #1 by samark
New block was created by samark
Hi, can someone share steps for creating a new custom block? I had some in PHPGedView but it seems like blocks are now created as modules in webtrees. Right?

Any guidance would be useful. Thanks

Samar

Please Log in or Create an account to join the conversation.

  • samark
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #2 by samark
Replied by samark on topic New block
Also, I specifically used to use the function $pgv_lang to pull custom phrases I had added into the xml into the block. How should I do this with webtrees?

Samar

Please Log in or Create an account to join the conversation.

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
7 years 3 months ago #3 by fisharebest
Replied by fisharebest on topic New block
> Hi, can someone share steps for creating a new custom block? I had some in PHPGedView but it seems like blocks are now created as modules in webtrees. Right?

Look at modules_v3/_custom.php for an example of how to create a custom module.

Look at a simple block (e.g. "Welcome block") to see how to create a module that implements a block. (i.e. you need to write one function that provides the content).

> Also, I specifically used to use the function $pgv_lang

You module can supply language files. (modules_v3/XXXXXX/language/*.mo)
webtrees will use these automatically.
Just use the normal translation functions: I18N::translate('english text');

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • samark
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #4 by samark
Replied by samark on topic New block
The language files in phpgedview used to be xml. In webtrees its mo. How do I edit to add new phrases?

Samar

Please Log in or Create an account to join the conversation.

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
7 years 3 months ago #5 by fisharebest
Replied by fisharebest on topic New block

samark wrote: The language files in phpgedview used to be xml. In webtrees its mo. How do I edit to add new phrases?


Create a .CSV or .MO or .PHP file that contains your translations.

See wiki.webtrees.net/en/Custom_Translation for more information.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}