Jump to content
TNG Community
Derrick

Template 13 - disable media type?

Recommended Posts

Derrick

I'm using template 13, v12.0.2.  I see this code on the index.php page:

<?php
    foreach( $mediatypes as $mediatype ) {
        if(!$mediatype['disabled']) {
            echo "<li><a href=\"browsemedia.php?mediatypeID={$mediatype['ID']}\">{$mediatype['display']}</a></li>\n";
        }
    }
?>

But, I don't see anywhere in admin how to "disable media types" so they don't appear among the list on my homepage? I can delete "reports," for instance, since that has its own line. But there are no lines here for histories, recordings, or videos. I'm sure I'm missing something obvious, but I can't find it. Can anyone tell me where this might be?

homepage: https://buffalo.pitard.net/index.php

Share this post


Link to post
Share on other sites
tngrlkrz

I believe the  a mediatype variable is set to disabled for all types initially, and then for each media type that is found, it is turned off,  thus causing the menu item to appear for that media type. For example, I have no videos, so that menu item doesn't appear for me in template 13.  I find no flag for the user to disable a particular type, but you could set that up with your own custom statements in index.php fof which ones you wish to appear instead of that code being executed. 

example:

<li><a href="browsemedia.php?mediatypeID=photos"><?php echo $text['photos']; ?></a></li> 

(use the variable $text in case you want translation)

So if there are no photos, then the menu for photos will not appear.  I think the code was merely put there to generate  media menu items only for those that exist.

Ron

Share this post


Link to post
Share on other sites
theKiwi
2 hours ago, Derrick said:

I'm using template 13, v12.0.2.  I see this code on the index.php page:

<?php
    foreach( $mediatypes as $mediatype ) {
        if(!$mediatype['disabled']) {
            echo "<li><a href=\"browsemedia.php?mediatypeID={$mediatype['ID']}\">{$mediatype['display']}</a></li>\n";
        }
    }
?>

But, I don't see anywhere in admin how to "disable media types" so they don't appear among the list on my homepage? I can delete "reports," for instance, since that has its own line. But there are no lines here for histories, recordings, or videos. I'm sure I'm missing something obvious, but I can't find it. Can anyone tell me where this might be?

homepage: https://buffalo.pitard.net/index.php

There is an option in the TNG Admin ------> Import ------> Secondary Processes to "Trim Media Menu" - this is what does the disabling I imagine.

Roger

Share this post


Link to post
Share on other sites
manofmull

I'm wondering if Derrick is referring to custom media types, that from TNG11 are auto-linked on the homepage?

If this is the case (and I prefer not to have them myself), the following will show your homepage links as they used to in TNG10 back

edit the template13 index.php page, by removing this code from lines 181-187:

<?php
foreach( $mediatypes as $mediatype ) {
if(!$mediatype['disabled']) {
echo "<li><a href=\"browsemedia.php?mediatypeID={$mediatype['ID']}\">{$mediatype['display']}</a></li>\n";
}
}
?>

Replace that with this:

<li><a href="browsemedia.php?mediatypeID=photos"><?php echo $text['mnuphotos']; ?></a></li>
<li><a href="browsemedia.php?mediatypeID=histories"><?php echo $text['mnuhistories']; ?></a></li>
<li><a href="browsemedia.php?mediatypeID=documents"><?php echo $text['documents']; ?></a></li>
<li><a href="browsemedia.php?mediatypeID=videos"><?php echo $text['videos']; ?></a></li>
<li><a href="browsemedia.php?mediatypeID=recordings"><?php echo $text['recordings']; ?></a></li>
 

This should get your links back to normal 

 

Michael

Share this post


Link to post
Share on other sites
Derrick

That last would work, and I think I've done that in the past, but Roger's "trim media menus" did the trick. I was thinking that the code must have referred to a switch somewhere that I had missed.

Thank you all.

Derrick

Share this post


Link to post
Share on other sites
manofmull

Derrick

Glad it's sorted.

I removed links from my homepage per above and also by removing the associated lines from the template index.php page

 

M

Share this post


Link to post
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

×