Jump to content
TNG Community

How can I configure "What's New" to eliminate a Heading for "Photos"? I have not images attached to any individuals or events in my TNG 13.1.2. However, each time I upload and install a new gedcom, there are image files listed there.


bridgebum

Recommended Posts

How comfortable are you at changing a bit of code?

The What's New section is controlled by the whatsnew.php program.

In that file, at about line 133, you will find a block of code similar to this:

foreach( $mediatypes as $mediatype ) {
	$mediatypeID = $mediatype['ID'];
	$header = $mediatypeID == "headstones" ? $header1 . $hsheader . $header2 : $header1 . $header2;
	echo doMedia( $mediatypeID );
}

 

You need to change the fourth line to:

	if ($mediatypeID <> "photos") {echo doMedia( $mediatypeID );}

 

Or whatever your photo collection is called. This will suppress the Photo collection in the What's New page.

Please note there may be other ways to do this, and if you update TNG you may lose this code change; you could write it as a Mod if you wanted. I have based the above code and line numbers on TNG V13. 

Link to comment
Share on other sites

As an addendum to my reply to your question, you say that you do not have any media attached to any individuals in TNG. This is not correct, as can be seen in the What's New section itself - for example, you have a photo with a filename of "armyretirement.jpg" attached to WHEELER, James Ernest "Jim". You last updated his record on 16 Apr 2023, which is maybe when you added the media.

You should also note that Media does not need to be attached to any person or event to appear in the What's New section. 

Finally, I don't know what you mean when you posted the message "no images" above.

In any case, the code modification will suppress all photos, but it is important to understand what it is changing and why.

 

Link to comment
Share on other sites

I'm getting an Error 500 after modifying the whatsnew.php file. I guess I would be better off with a Mod, if someone would be kind enough to cook one up for me. Thanks in advance!!

Gene

Link to comment
Share on other sites

I have just tried this change and all went well..

Try clearing browser cache and logging out of TNG then closing the browser.

Maybe upload your modified whatsnew.php file here or pm it to me.. I will check it for you.

Link to comment
Share on other sites

I would suggest checking your typing very carefully as it is very easy to miss, or mistype, some of the brackets and punctuation.

The block should read:

foreach( $mediatypes as $mediatype ) {
	$mediatypeID = $mediatype['ID'];
	$header = $mediatypeID == "headstones" ? $header1 . $hsheader . $header2 : $header1 . $header2;
	if ($mediatypeID <> "photos") {echo doMedia( $mediatypeID );}
}

The only problem I can see is if your collection is not called "photos", but that's unlikely.

As Rick has suggested if you post the file here, or paste the relevant section, we can check it for you.

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...