HTML block variables

Predefined variables for use in kiwitrees HTML blocks

One of the most effective ways to make your family tree site unique is to use the “HTML” block. This allows you to add a huge variety of format text, images, tables, and even to link to key information from your tree.

Don’t forget as well that you can add the block as a small one on the right, a medium one on the left, or, if you remove all blocks from the right, as a full page width block. (In some themes, such as “kiwitrees”, left and right actually mean top and bottom).

Writing HTML code is of course too daunting for many, so kiwitrees provides a very handy editor to save you having to worry about that.  But the major item you won’t find in the editor (easily) is what the many kiwitrees functions are that you can embed. The list is very long and ranges from statistical information, details of your designated “favourite” records, even information about the newest users registered on your site. You can even embed other blocks such as charts, or even a login block.

If you want to know exactly which functions are available and how they will display using your tree data follow these steps after you have added the HTML block to your Homepage:

  1. Click on the configuration icon in the header of the block (for a new block this is the only thing you see)
  2. Look for the field “Templates” and  select “Keyword examples” from it’s drop-down list (But first see point 4 below)
  3. Save the HTML block (no other settings are necessary for this as it is only meant as a temporary item).
  4. Now be patient. Displaying all the functions, which is what this does, can take at least a few minutes depending how large your tree is. For very large trees this might even crash your server, so in such cases best you don’t try. The same details can be seen in the table of variables provided below here.)

From this list you can select any item from the column “Embedded variable” and use it in you ‘real’ HTML block. It will display as shown in the right-hand column “Resulting value”. To use the variable you simply need to surround it with a “#” (hash) symbol at either end, like “#commonGivenMale# “.

If you don’t want to do all of that, and can live with data different from your own, just to get a general idea of what each function does, there is a complete “Keyword examples” list below here.

Finally, there is one multi-function variable and a few that accept varying parameters.

Adding other blocks inside an HTML block

The multi-function variable is “##callBlock:xxxxxxxxxxxxx#. This is how you add other blocks inside the HTML block. An example might be the “random media” block, added by using #callBlock:random_media# or the “number of page views” block, added using #callBlock:top10_pageviews#.

A typical one with parameters might be “#callBlock:charts:type=hourglass:pid=I11:details=1# This embeds an hourglass chart for individual I11, showing full details. These parameters correspond to the configurable settings of the charts block when used on its own. The order of parameters is not important, but:

  1. They must be preceded by a colon (“:”)
  2. They must use the same identifiers as the original block. You will need to check these against the code for that block in it’s /modules_v3/block name/modules.php file
  3. Use 0 or 1 instead of no / yes where those words are used in the normal configuration.

If the “callBlock” code doesn’t seem to be working, check these two settings:

  1. Is the module you want to insert enabled (Administration > Modules > Manage modules)
  2. If enabled, check the module has the correct access settings (Administration > Modules > Blocks).

Keyword examples list

(Note: links in these examples are disabled and will return you to this page.)

Embedded variable Resulting value
KT_VERSION 2.0.2
KT_VERSION_TEXT 2.0.2
ageBetweenSpousesFM Charles Robert Darwin + Emma Wedgwood (1 year);  Robert Darwin + Susannah Wedgwood (1 year)
ageBetweenSpousesFMList
ageBetweenSpousesMF Rev. Charles Langton + Emily Catherine Darwin (9 years);  Josiah Wedgwood III + Caroline Sarah Darwin (5 years);  Josiah Wedgwood I + Sarah Wedgwood (4 years)
ageBetweenSpousesMFList
averageChildren 2.05
averageLifespan 71
averageLifespanFemale 70
averageLifespanMale 72
browserDate 13 September 2014
browserTime 5:58 pm
browserTime24 17:58
browserTimezone NZST
callBlock
chartCommonGiven Erasmus - 5, Darwin - 5, Charles - 5, George - 4, Robert - 4, Sir - 4, Francis - 3, Other - 25
chartCommonSurnames Darwin - 35, Wedgwood - 6, Luard - 2, Ruck - 1, Puy - 1, Service - 1, Slingsby - 1, Other - 8
chartDistribution

Individual distribution chart

Individual distribution chart

Highest population Lowest population Nobody at all
chartFamsWithSources Families with sources
chartIndisWithSources Individuals with sources
chartLargestFamilies Largest families
chartMedia Document (3), Photo (8)
chartMortality Living - 54.5%, Dead - 45.5%
chartNoChildrenFamilies
chartSex Males - 52.7%, Females - 47.3%
commonBirthPlacesList
commonCountriesList
commonDeathPlacesList
commonGiven Erasmus, Darwin, Charles, George, Robert, Sir, Francis, Leonard, William, Josiah
commonGivenFemale Sarah, Elizabeth, Jane, Camilla, Katharine, Margaret, Sophia, Cecily, Jennifer, Susannah
commonGivenFemaleList
  • Sarah
  • Elizabeth
  • Jane
  • Camilla
  • Katharine
  • Margaret
  • Sophia
  • Cecily
  • Jennifer
  • Susannah
commonGivenFemaleListTotals
  • Sarah (3)
  • Elizabeth (2)
  • Jane (2)
  • Camilla (2)
  • Katharine (1)
  • Margaret (1)
  • Sophia (1)
  • Cecily (1)
  • Jennifer (1)
  • Susannah (1)
commonGivenFemaleTable
Female
Name Count COUNT
Sarah 3 3
Elizabeth 2 2
Jane 2 2
Camilla 2 2
Katharine 1 1
Margaret 1 1
Sophia 1 1
Cecily 1 1
Jennifer 1 1
Susannah 1 1
commonGivenFemaleTotals Sarah (3), Elizabeth (2), Jane (2), Camilla (2), Katharine (1), Margaret (1), Sophia (1), Cecily (1), Jennifer (1), Susannah (1)
commonGivenList
  • Erasmus
  • Darwin
  • Charles
  • George
  • Robert
  • Sir
  • Francis
  • Leonard
  • William
  • Josiah
commonGivenListTotals
  • Erasmus (5)
  • Darwin (5)
  • Charles (5)
  • George (4)
  • Robert (4)
  • Sir (4)
  • Francis (3)
  • Leonard (3)
  • William (3)
  • Josiah (3)
commonGivenMale Erasmus, Darwin, Charles, Sir, Robert, George, Galton, Leonard, Francis, William
commonGivenMaleList
  • Erasmus
  • Darwin
  • Charles
  • Sir
  • Robert
  • George
  • Galton
  • Leonard
  • Francis
  • William
commonGivenMaleListTotals
  • Erasmus (5)
  • Darwin (5)
  • Charles (5)
  • Sir (4)
  • Robert (4)
  • George (4)
  • Galton (3)
  • Leonard (3)
  • Francis (3)
  • William (3)
commonGivenMaleTable
Male
Name Count COUNT
Erasmus 5 5
Darwin 5 5
Charles 5 5
Sir 4 4
Robert 4 4
George 4 4
Galton 3 3
Leonard 3 3
Francis 3 3
William 3 3
commonGivenMaleTotals Erasmus (5), Darwin (5), Charles (5), Sir (4), Robert (4), George (4), Galton (3), Leonard (3), Francis (3), William (3)
commonGivenTable
All
Name Count COUNT
Erasmus 5 5
Darwin 5 5
Charles 5 5
George 4 4
Robert 4 4
Sir 4 4
Francis 3 3
Leonard 3 3
William 3 3
Josiah 3 3
commonGivenTotals Erasmus (5), Darwin (5), Charles (5), George (4), Robert (4), Sir (4), Francis (3), Leonard (3), William (3), Josiah (3)
commonGivenUnknown
commonGivenUnknownList
commonGivenUnknownListTotals
commonGivenUnknownTable
commonGivenUnknownTotals
commonMarriagePlacesList
commonSurnames Ashburner, Christie, Darwin, Gibon, Howard, Langton, Litchfield, Luard, Parker, Pember, Puy, Ruck, Service, Slingsby, Wedgwood
commonSurnamesList
commonSurnamesListTotals
commonSurnamesTotals Darwin (35), Wedgwood (6), Luard (2), Langton (1), Howard (1), Ashburner (1), Gibon (1), Parker (1), Litchfield (1), Christie (1), Ruck (1), Puy (1), Service (1), Slingsby (1), Pember (1)
contactGedcom Admin
contactWebmaster Admin
firstBirth Josiah Wedgwood I
Birth 21 February 1730
Death 1795 (Age 64)
firstBirthName Josiah Wedgwood I
firstBirthPlace
firstBirthYear 1730
firstDeath Charles Darwin
Birth 1758 27
Death 1778 (Age 20)
firstDeathName Charles Darwin
firstDeathPlace
firstDeathYear 1778
firstDivorce
firstDivorceName
firstDivorcePlace
firstDivorceYear
firstEvent Josiah Wedgwood I
Birth 21 February 1730
Death 1795 (Age 64)
firstEventName Josiah Wedgwood I
firstEventPlace
firstEventType birth
firstEventYear 1730
firstMarriage Josiah Wedgwood II +
Marriage about 1790 – span dir=”auto”>England
firstMarriageName Josiah Wedgwood II +
firstMarriagePlace England
firstMarriageYear 1790
gedcomCreatedSoftware webtrees
gedcomCreatedVersion 1.4.3
gedcomDate 12 October 2013
gedcomFavorites
Favourites

 

gedcomFilename wedgewood.ged
gedcomID 1
gedcomRootID I18
gedcomRootIDname Josiah Wedgwood III
gedcomTitle Wedgewood
gedcomUpdated 9 July 2014
getCommonSurname Darwin
hitCount 4,606
hitCountFam
hitCountIndi
hitCountNote
hitCountObje
hitCountRepo
hitCountSour
hitCountUser 88
largestFamily Charles Robert Darwin + Emma Wedgwood
largestFamilyName Charles Robert Darwin + Emma Wedgwood
largestFamilySize 8
lastBirth Sophia Katherine Darwin
Birth 1961 32
lastBirthName Sophia Katherine Darwin
lastBirthPlace
lastBirthYear 1961
lastDeath Charles Galton Darwin
Birth 1887
Death 1962 (Age 75)
lastDeathName Charles Galton Darwin
lastDeathPlace
lastDeathYear 1962
lastDivorce
lastDivorceName
lastDivorcePlace
lastDivorceYear
lastEvent Charles Galton Darwin
Birth 1887
Death 1962 (Age 75)
lastEventName Charles Galton Darwin
lastEventPlace
lastEventType death
lastEventYear 1962
lastMarriage Josiah Wedgwood II +
Marriage about 1790England
lastMarriageName Josiah Wedgwood II +
lastMarriagePlace England
lastMarriageYear 1790
latestUserFullName John Smith
latestUserId 2
latestUserLoggedin no
latestUserName nigel
latestUserRegDate 5 July 2014
latestUserRegTime 11:54:27
longestLife Leonard Darwin
Birth 1850 41 42
Death 1943 (Age 93)
longestLifeAge 93
longestLifeFemale Emma Wedgwood
Birth 1808
Death 1896 (Age 88)
longestLifeFemaleAge 88
longestLifeFemaleName Emma Wedgwood
longestLifeMale Leonard Darwin
Birth 1850 41 42
Death 1943 (Age 93)
longestLifeMaleAge 93
longestLifeMaleName Leonard Darwin
longestLifeName Leonard Darwin
minAgeOfMarriage
minAgeOfMarriageFamilies
minAgeOfMarriageFamiliesList
minAgeOfMarriageFamily
noChildrenFamilies 7
noChildrenFamiliesList
oldestFather Charles Galton Darwin
Birth 1887
Death 1962 (Age 75)
oldestFatherAge 51
oldestFatherName Charles Galton Darwin
oldestMarriageFemale
oldestMarriageFemaleAge
oldestMarriageFemaleName
oldestMarriageMale
oldestMarriageMaleAge
oldestMarriageMaleName
oldestMother Susannah Wedgwood
Birth 1765 34 31
Death 1817 (Age 52)
oldestMotherAge 45
oldestMotherName Susannah Wedgwood
serverDate 13 September 2014
serverTime 5:57 pm
serverTime24 17:57
serverTimezone NZST
statsAge Average age related to death century
statsBirth Births by century
statsChildren Average number of children per family
statsDeath Deaths by century
statsDiv
statsMarr Marriages by century
statsMarrAge
topAgeBetweenSiblings 12 years
topAgeBetweenSiblingsFullName Josiah Wedgwood III
Birth 1795
Death 1880 (Age 85)

and
Emma Wedgwood
Birth 1808
Death 1896 (Age 88)

[View Family]
topAgeBetweenSiblingsList
topAgeBetweenSiblingsName Josiah Wedgwood III and Emma Wedgwood [View Family]
topAgeOfMarriage
topAgeOfMarriageFamilies
topAgeOfMarriageFamiliesList
topAgeOfMarriageFamily
topTenLargestFamily Charles Robert Darwin + Emma Wedgwood – 8 children;  Robert Darwin + Susannah Wedgwood – 6 children;  Charles Galton Darwin + Katharine Pember – 5 children;  George Howard Darwin + Maud du Puy – 4 children;  William Robert Darwin + Sarah Monica Slingsby – 3 children;  Erasmus Darwin + Mary Howard – 3 children;  Josiah Wedgwood I + Sarah Wedgwood – 2 children;  Edward Leonard Darwin + Jennifer Gibon – 2 children;  Josiah Wedgwood II + – 2 children;  George Erasmus Darwin + Shuna Service – 2 children
topTenLargestFamilyList
topTenLargestGrandFamily Josiah Wedgwood I + Sarah Wedgwood – 8 grandchildren;  George Howard Darwin + Maud du Puy – 8 grandchildren;  Robert Darwin + Susannah Wedgwood – 8 grandchildren;  Josiah Wedgwood II + – 8 grandchildren;  Erasmus Darwin + Mary Howard – 6 grandchildren;  Charles Robert Darwin + Emma Wedgwood – 4 grandchildren;  Charles Galton Darwin + Katharine Pember – 3 grandchildren;  William Robert Darwin + Sarah Monica Slingsby – 3 grandchildren
topTenLargestGrandFamilyList
topTenOldest Leonard Darwin (93 years) Emma Wedgwood (88 years) Caroline Sarah Darwin (88 years) Josiah Wedgwood III (85 years) Rev. Charles Langton (85 years) Henrietta Darwin (84 years) Sarah Wedgwood (81 years) Elizabeth Darwin (79 years) Robert Darwin (78 years) Erasmus Darwin (77 years)
topTenOldestAlive Margaret Elizabeth Darwin (124 years);  William Robert Darwin (120 years);  George Erasmus Darwin (87 years);  Philip Waring Darwin (85 years);  Henry Galton Darwin (85 years);  Francis William Darwin (82 years);  Jane Darwin (79 years);  George Pember Darwin (76 years);  Robert Darwin (55 years);  Sophia Katherine Darwin (53 years)
topTenOldestFemale Emma Wedgwood (88 years) Caroline Sarah Darwin (88 years) Henrietta Darwin (84 years) Sarah Wedgwood (81 years) Elizabeth Darwin (79 years) Emily Catherine Darwin (76 years) Marianne Darwin (60 years) Susannah Wedgwood (52 years) Anne Darwin (10 years)
topTenOldestFemaleAlive Margaret Elizabeth Darwin (124 years);  Jane Darwin (79 years);  Sophia Katherine Darwin (53 years)
topTenOldestFemaleList
topTenOldestFemaleListAlive
topTenOldestList
topTenOldestListAlive
topTenOldestMale Leonard Darwin (93 years) Josiah Wedgwood III (85 years) Rev. Charles Langton (85 years) Robert Darwin (78 years) Erasmus Darwin (77 years) Horace Darwin (77 years) Francis Darwin (77 years) William Erasmus JP Darwin (75 years) Charles Galton Darwin (75 years) Charles Robert Darwin (73 years)
topTenOldestMaleAlive William Robert Darwin (120 years);  George Erasmus Darwin (87 years);  Philip Waring Darwin (85 years);  Henry Galton Darwin (85 years);  Francis William Darwin (82 years);  George Pember Darwin (76 years);  Robert Darwin (55 years);  Christopher Darwin (53 years)
topTenOldestMaleList
topTenOldestMaleListAlive
totalAdmins 1
totalBirths 34
totalChildren 39
totalDeaths 25
totalDeceased 25
totalDeceasedPercentage 45.5%
totalDivorces 0
totalEvents 60
totalEventsBirth 34
totalEventsDeath 25
totalEventsDivorce 0
totalEventsMarriage 1
totalEventsOther 0
totalFamilies 19
totalFamiliesPercentage 25.7%
totalFamsWithSources 0
totalGedcomFavorites 1
totalGedcomNews 0
totalGivennames 53
totalIndisWithSources 0
totalIndividuals 55
totalIndividualsPercentage 74.3%
totalLiving 30
totalLivingPercentage 54.5%
totalMarriages 1
totalMarriedFemales 2
totalMarriedMales 2
totalMedia 11
totalMediaAudio 0
totalMediaBook 0
totalMediaCard 0
totalMediaCertificate 0
totalMediaCoatOfArms 0
totalMediaDocument 3
totalMediaElectronic 0
totalMediaFiche 0
totalMediaFilm 0
totalMediaMagazine 0
totalMediaManuscript 0
totalMediaMap 0
totalMediaNewspaper 0
totalMediaOther 0
totalMediaPainting 0
totalMediaPhoto 8
totalMediaTombstone 0
totalMediaUnknown 0
totalMediaVideo 0
totalNonAdmins 1
totalNotes 0
totalNotesPercentage 0.0%
totalPlaces 1
totalRecords 74
totalRepositories 0
totalRepositoriesPercentage 0.0%
totalSexFemales 26
totalSexFemalesPercentage 47.3%
totalSexMales 29
totalSexMalesPercentage 52.7%
totalSexUnknown 0
totalSexUnknownPercentage 0.0%
totalSources 0
totalSourcesPercentage 0.0%
totalSurnames 16
totalUserFavorites 0
totalUserJournal 0
totalUserMessages 0
totalUsers 2
userFavorites
Favourites
userFullName Admin
userID 1
userName admin
usersLoggedIn 1 logged-in user: Admin – admin
usersLoggedInList 1 logged-in user

  • Admin – admin
usersLoggedInTotal 1
usersLoggedInTotalAnon 0
usersLoggedInTotalVisible 1
youngestFather Erasmus Darwin
Birth 1731
Death 1802 (Age 71)
youngestFatherAge 27
youngestFatherName Erasmus Darwin
youngestMarriageFemale
youngestMarriageFemaleAge
youngestMarriageFemaleName
youngestMarriageMale
youngestMarriageMaleAge
youngestMarriageMaleName
youngestMother Sarah Wedgwood
Birth 1734
Death 1815 (Age 81)
youngestMotherAge 31
youngestMotherName Sarah Wedgwood


10 Comments
bootsbootes

bootsbootes » 15 Sep 2014 »

Thank you for sharing this post and useful information. When I tried this I only got the first 4 or five variables displayed in the block and there were no scrollbars allowing me to see more. It could be that I have a large tree ~13,000 people.

bootsbootes

bootsbootes » 22 Nov 2014 »

I currently have an HTML block that displays images from outside the kiwitrees media system using code such as src=”../images/photo1.jpg”

How would I use a specific image that is within the kiwitrees mediafirewall such as M123 from the HTML block code?

Paul (I hope this makes sense!)

jacoline » 26 Oct 2018 »

Thank you for the fix 🙂
Have a question. How to add block setting for the todo in the html block?

#callBlock:todo:block=true#

Is not right 😀

kiwi

kiwi » 26 Oct 2018 »

You don’t actually need the “:block=true” part, but it does work for me with or without that.

The only things I can think to check are:
1 – Module enabled?
2 – Module-block set for correct access level AND click “save”?
3 – Are there any todo items to display?

jacoline » 26 Oct 2018 »

No I want the setup from the ordinary block
Show research tasks that:
are assigned to other users no/yes
that are mpt assigned to ony users no/yes
that have a date in the future no/yes
———
Add a scrollbar when block contents grow no/yes

jacoline » 26 Oct 2018 »

* that are not assigned not that are mpt assigned

kiwi

kiwi » 27 Oct 2018 »

I see. So it is working for you, but you are not able to configure it?

That will be caused by the third point in the text above that says:

3 Use 0 or 1 instead of no / yes where those words are used in the normal configuration.

You must use 0/1 not false/true or no/yes.

But you only need to use these parameters if you want to change the defaults, which are ‘yes’ for all 4.

A complete ‘set’ of parameters, all set to ‘no’ would be:
#callBlock:todo:show_other=0:show_futureunassigned=0:show_future=0#

BUT….
1 – note there is no “block” parameter (used to set/unset scrollbars). This cannot be used for blocks embedded in HTML block. To introduce scrollbars there you need to place the callBlock in a container (div/p/span etc) and give it a fixed height with css)

2 – There seems to be a problem with “unassigned” tasks (ones with no user entered when the task as created). For now, do not set ‘show_unassigned’ to ‘no’ or 0. I need to investigate the cause. It’s rare (I believe) to not set a user (ususally yourself), which is why it has never appeared as a problem before.

jacoline » 27 Oct 2018 »

Well I removed it from the table so I can have the scroll. And to test why the english version is not “shrinking” in the left column. It works in the danish version. It is annoying. The tables are like. Do not know why the english version is not “shrinking”. I hoped it was the “todo list” that was doing something.

I am giving up 🙁

kiwi

kiwi » 27 Oct 2018 »

Happy to try and help. But please start a support forum topic, and include pictures, links to examples etc. These comments don’t work well for help, only discussion.

It sounds like simple css errors.

Have your say!

Have your say!

This site uses Akismet to reduce spam. Learn how your comment data is processed.