Plugin

Archived
Forum
(read-only)

Child Categories

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Laisvunas

     

PHP Erros

Support Request

Maza
Maza

Getting below errors after updating to 3.1, running on EE 2.7.2

Your help would be greatly appreciated.

_______________________
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 4

Filename: child_categories/pi.child_categories.php

Line Number: 834
A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 5

Filename: child_categories/pi.child_categories.php

Line Number: 834
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/kiro/system/codeigniter/system/core/Exceptions.php:170)

Filename: core/Common.php

Line Number: 412

Laisvunas
# 1
Developer
Laisvunas

Hi,

Plese, post here your code which outputs error messages.

Maza
# 2
Maza

Hi,

ok here we go:

{exp:channel:categories channel="services" parent_only="yes"}
        
<div class="brick col-lg-4 col-md-4 col-sm-6 col-xs-12">
      <
a href="/index.php/hvem-vi-behandler/{category_url_title}/" class="img-hov">
               <
figure class="responsive">
   <
img src="{category_image}" alt="{category_name}"/>
   <
figcaption class="image-area"><h2>{category_name}</h2></figcaption>
        </
figure>
        <
article class="hover-content">
   <
h2>{category_name}</h2>
   <
p>
   
{exp:child_categories dynamic_detect_channel="services" parent="{category_id}" child_categories_sort_by="custom" child_categories_sort_direction="asc" show_empty="yes" entries_sort_by="date" entries_sort_direction="asc" site="1"}
    {child_category_start}
<span>{child_category_name}</span>{child_category_end}
   {
/exp:child_categories}
   
</p>
        </
article><!-- /.hover-content -->
     </
a>
        </
div><!-- /.brick-->
        
{/exp:channel:categories} 

Laisvunas
# 3
Developer
Laisvunas

Hi,

Since you wrap exp:child_categories tag pair with the tag pair exp:channel:categories, you need to add parameter

parse="inward" 

to the exp:channel:categories.

Also notice that the tag exp:child_categories does not have parameter “dynamic_detect_channel”.

Maza
# 4
Maza

Thanks a lot, the parse=“inward” did the job for me.