Jump to content
TNG Community

Single Child Collapse


stores

Recommended Posts

Looking for some guidance on what to modify so that a couples single child will collapse just as a couples multiple children currently do in my tree as shown in the attached examples. 

Using TNG v11.1.2 offline via wamp64.

single child.jpg

miltiple children.jpg

Link to comment
Share on other sites

Hi Jim,

If you are using Jeff Robison's Collapse Family Children mod  (TNG doesn't collapse them by default, only media) , then change this line 90 in the cfg file:

if ($kidcount > 2 ) {

to

if ($kidcount > 1 ) {

If you also wish to do this with photos, docs, etc. (I do) , then change this (~line 903 in tng 11.1.2) in personlib.php; (being mindful of other mods you may have installed).

%target:personlib.php 
%location:%
                $hidemedia = $tngconfig['hidemedia'] && $totalmedia > 1;
%end:%
%replace:%
               $hidemedia = $tngconfig['hidemedia'] && $totalmedia > 0;
%end:%

However,  in both cases, you will need to be satisfied with the row description (not the label)  of '1 children, 1 photos, 1 documents,  ...unless the description is removed altogether.  That us, unless more changes are made.

Ron

Link to comment
Share on other sites

Thanks Ron

Modifying line 90 of Jeff Robison's Collapse Family Children mod worked like a charm... I never looked in that file and was looking in the tng core files for the fix.

I had already modified personlib.php some time back to collapse the photos, docs and other things with single entries and single children was the last one to figure out.

Thank you again... Jim

Link to comment
Share on other sites

Jim,

In the Collapse Family Children cfg file,

if, for English only, you wish to display '1 child' singular instead of '1 children' plural for the description, add the middle line below:

              $label2 = $kidcount -1 . " " . strtolower($text['children']);
              if ($label2=="1 children") $label2="1 child"; //only does singular for English
              array_unshift($famchildren, $label2);    

If you wish to have 'Child' and 'Children' instead of lowercase, do this:

              $label2 = $kidcount -1 . " " . ($text['children']);
              if ($label2=="1 Children") $label2="1 Child"; //only does singular for English
              array_unshift($famchildren, $label2);    

Ron

 

 

Link to comment
Share on other sites

Thanks Ron,

I could have lived with 1 children but seeing 1 child does look much better, Thanks again. Jim

 

Link to comment
Share on other sites

You might want to use a $text variable instead

if ($label2=="1 children") $label2="1 {$text['child']} "; 

Note that I have not tested this to ensure I had the correct syntax

Link to comment
Share on other sites

Thanks Ken,

Ron's fix works and looks great so i will stick with that for now.

Basically, when i initially made Ron's changes i was getting double children fields and a few other odd errors that pointed to other mods that were not corrected by un installing the various mods, then reinstalling them, so i backed up to a full wamp backup i made last week, then made Ron's changes to that setup, and the changes worked great, so i just needed to reload the gedcom i created this week. Basically, "if it ain't broke, don't fix it" (ha ha). Thanks again, Jim 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...