Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

July 13, 2020, 11:18:54 AM

Login with username, password and session length
Members
  • Total Members: 3786
  • Latest: Deaks
Stats
  • Total Posts: 190436
  • Total Topics: 20856
  • Online Today: 140
  • Online Ever: 917
  • (January 21, 2020, 09:02:26 AM)
Users Online
Users: 2
Guests: 54
Total: 56

Author Topic: TP 1b3 : child categorie not list when there is no articles in parent category  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

gcivili

  • Guest
Hi All

In admin, when in parent category are not present articles do not show the child categories

I edit TPortalAdmin.template.php

Code: [Select]

// any articles then?
if(!empty($context['TPortal']['editarticles']))
{

echo '
<tr class="catbg"><td colspan="6">'.$context['TPortal']['currentcategory'].'</td></tr>';
// any childcategories?
if(!empty($context['TPortal']['childcategories']))
{
foreach($context['TPortal']['childcategories'] as $cat => $link)
echo '
<tr class="titlebg2">
<td colspan="6">' , $txt['tp-childcategories'] , '</td>
</tr>
<tr class="windowbg">
<td colspan="6">' , $link , '</td>
</tr>';
}
echo '
<tr class="catbg3">
<td>'.$txt['tp-pos'].' / '.$txt['tp-name'].'</td>
<td width="5%"> '.$txt['tp-author'].'</td>
<td width="20%"> '.$txt['tp-date'].'</td>
<td width="10%"> '.$txt['tp-display'].'</td>
<td width="1%"> '.$txt['tp-featured'].'</td>
<td width="1%"> '.$txt['tp-delete'].'</td>
</tr>';
if( !empty($context['TPortal']['pageindex']))
echo '
<tr class="titlebg2"><td colspan="6">'.$context['TPortal']['pageindex'].'</td></tr>';

foreach($context['TPortal']['editarticles'] as $alink)

         

I changed in this way

Code: [Select]

  if(!empty($context['TPortal']['editarticles']) || !empty($context['TPortal']['childcategories'])) {
echo '
<tr class="catbg"><td colspan="6">'.$context['TPortal']['currentcategory'].'</td></tr>';
}

// any childcategories?
if(!empty($context['TPortal']['childcategories']))
{
foreach($context['TPortal']['childcategories'] as $cat => $link)
echo '
<tr class="titlebg2">
<td colspan="6">' , $txt['tp-childcategories'] , '</td>
</tr>
<tr class="windowbg">
<td colspan="6">' , $link , '</td>
</tr>';

echo '
<tr class="catbg3">
<td>'.$txt['tp-pos'].' / '.$txt['tp-name'].'</td>
<td width="5%"> '.$txt['tp-author'].'</td>
<td width="20%"> '.$txt['tp-date'].'</td>
<td width="10%"> '.$txt['tp-display'].'</td>
<td width="1%"> '.$txt['tp-featured'].'</td>
<td width="1%"> '.$txt['tp-delete'].'</td>
</tr>';
if( !empty($context['TPortal']['pageindex']))
echo '
<tr class="titlebg2"><td colspan="6">'.$context['TPortal']['pageindex'].'</td></tr>';
}

// any articles then?
if(!empty($context['TPortal']['editarticles']))
{

foreach($context['TPortal']['editarticles'] as $alink)

.............


         

now work ...