TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 05:46:52 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 167
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 137
  • Total: 137

TP 1b3 : child categorie not list when there is no articles in parent category

Started by gcivili, March 09, 2009, 09:58:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gcivili

Hi All

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

I edit TPortalAdmin.template.php



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



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