[eluser]JanDoToDo[/eluser]
Hi guys,
I have four sections in my treeview. When I display the page with the first 3 sections it works. When i add the 4th section it breaks and doesnt even error, it just goes straight to "page cannot be displayed". Ive never seen this behaviour before so would like some help.
I load the data from MySQL for each of the four sections:
Code: $x['ref_categories'] = $this -> references -> get_resources('category', array('category_for' => 'reference', 'active' => 1), $language_id, 'order');
if ( ! empty($x['ref_categories'])) :
foreach($x['ref_categories'] as $id => $ref):
$x['ref_categories'][$id]['url'] = 'references/categories/' . $ref['url_key'];
// Get products that relate to this category
$refs = $this -> references -> get_reference_list($ref['category_id'], $this -> default_language, FALSE, FALSE, 'categories');
foreach ($refs as $ref) :
$ref['url'] = 'references/details/' . $ref['url_key'];
$x['ref_categories'][$id]['new_references'][] = $ref;
endforeach;
endforeach;
endif;
$x['ref_parameters'] = $this -> references -> get_resources('parameter', FALSE, $language_id, 'parameter_title');
if ( ! empty($x['ref_parameters'])) :
foreach($x['ref_parameters'] as $id => $ref):
$x['ref_parameters'][$id]['url'] = 'references/parameters/' . $ref['url_key'];
// Get references that relate to this parameter
$refs = $this -> references -> get_reference_list($ref['parameter_id'], $this -> default_language, FALSE, FALSE, 'parameters');
foreach ($refs as $ref) :
$ref['url'] = 'references/details/' . $ref['url_key'];
$x['ref_parameters'][$id]['new_references'][] = $ref;
endforeach;
endforeach;
endif;
$x['prod_categories'] = $this -> products -> get_resources('category', array('category_for' => 'product', 'active' => 1), $language_id, 'order');
if ( ! empty($x['prod_categories'])) :
foreach($x['prod_categories'] as $id => $ref):
$x['prod_categories'][$id]['url'] = 'products/categories/' . $ref['url_key'];
// Get products that relate to this category
$prods = $this -> products -> get_product_list($ref['category_id'], $this -> default_language, FALSE, FALSE, 'categories');
foreach ($prods as $prod) :
$prod['url'] = 'products/details/' . $prod['url_key'];
$x['prod_categories'][$id]['products'][] = $prod;
endforeach;
endforeach;
endif;
$x['prod_parameters'] = $this -> products -> get_resources('parameter', FALSE, $language_id, 'parameter_title');
if ( ! empty($x['prod_parameters'])) :
foreach($x['prod_parameters'] as $id => $ref):
$x['prod_parameters'][$id]['url'] = 'products/parameters/' . $ref['url_key'];
// Get products that relate to this parameter
$prods = $this -> products -> get_product_list($ref['parameter_id'], $this -> default_language, FALSE, FALSE, 'parameters');
foreach ($prods as $prod) :
$prod['url'] = 'products/details/' . $prod['url_key'];
$x['prod_parameters'][$id]['products'][] = $prod;
endforeach;
endforeach;
endif;
And then i call the view and load this view page which is echoed back to the controller to a variable:
[eluser]JanDoToDo[/eluser]
Code: <? $class = ($site_cat == 'references') ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<? $style = "text-decoration:none; color:#000;"; ?>
<?=anchor('references/index', lang('references'), array('style' => $style))?>
</span>
<ul>
<? $class = ($site_sect == 'categories') ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<?=anchor('references/categories', lang('categories'), array('style' => $style))?>
</span>
<? if (isset($ref_categories) && ! empty($ref_categories)) : ?>
<ul>
<? foreach ($ref_categories as $category) : ?>
<? $class = ($site_item == $category['url_key']) ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<?=anchor($category['url'], $category['category_title'], array('style' => $style));?>
</span>
<? if (isset($category['new_references']) && ! empty($category['new_references'])) : ?>
<ul>
<? foreach ($category['new_references'] as $reference) : ?>
<li>
<span class="file">
<?=anchor($reference['url'], $reference['title'], array('style' => $style));?>
</span>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
<? $class = ($site_sect == 'parameters' || $site_sect == 'details') ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder closed">
<?=anchor('references/parameters',lang('parameters'), array('style' => $style))?>
</span>
<? if (isset($ref_parameters) && ! empty($ref_parameters)) : ?>
<ul>
<? foreach ($ref_parameters as $parameter) : ?>
<? $class = ($site_item == $parameter['url_key']) ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<?=anchor($parameter['url'], $parameter['parameter_title'], array('style' => $style));?>
</span>
<? if (isset($parameter['new_references']) && ! empty($parameter['new_references'])) : ?>
<ul>
<? foreach ($parameter['new_references'] as $reference) : ?>
<li>
<span class="file">
<?=anchor($reference['url'], $reference['title'], array('style' => $style));?>
</span>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
</ul>
</li>
[eluser]JanDoToDo[/eluser]
Code: <? $class = ($site_cat == 'products') ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<? $style = "text-decoration:none; color:#000;"; ?>
<?=anchor('products/index', lang('products'), array('style' => $style))?>
</span>
<ul>
<? $class = ($site_sect == 'categories') ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<?=anchor('products/categories', lang('categories'), array('style' => $style))?>
</span>
<? if (isset($prod_categories) && ! empty($prod_categories)) : ?>
<ul>
<? foreach ($prod_categories as $category) : ?>
<? $class = ($site_item == $category['url_key']) ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<?=anchor($category['url'], $category['category_title'], array('style' => $style));?>
</span>
<? if (isset($category['products']) && ! empty($category['products'])) : ?>
<ul>
<? foreach ($category['products'] as $product) : ?>
<li>
<span class="file">
<?=anchor($product['url'], $product['title'], array('style' => $style));?>
</span>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
<? $class = ($site_sect == 'parameters' || $site_sect == 'details') ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder closed">
<?=anchor('products/parameters',lang('parameters'), array('style' => $style))?>
</span>
<? if (isset($prod_parameters) && ! empty($prod_parameters)) : ?>
<ul>
<? foreach ($prod_parameters as $ref_param) : ?>
<? $class = ($site_item == $ref_param['url_key']) ? '' : 'closed'; ?>
<li class="<?=$class?>">
<span class="folder">
<?=anchor($ref_param['url'], $ref_param['parameter_title'], array('style' => $style));?>
</span>
<? if (isset($ref_param['products']) && ! empty($ref_param['products'])) : ?>
<ul>
<? foreach ($ref_param['products'] as $prod_product) : ?>
<li>
<span class="file">
<? /*anchor($prod_product['url'], $prod_product['title'], array('style' => $style))*/;?>
</span>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
<? endforeach; ?>
</ul>
<? endif; ?>
</li>
</ul>
</li>
[eluser]JanDoToDo[/eluser]
And the problem is (as you can see i have commented out the line in the post directly above) if i uncomment this line, the page goes straight to "page cannot be displayed" and if i leave it commented out, the page loads fine.
So i thought maybe it is to do with the data in the array, but it is populated in exactly the same way as the others and i can vardump it in the controller and the data is fine. Is there a max limit to a page size or something? What would cause it to jump to "page cannot be displayed" instead of some kind of error message??
[eluser]JanDoToDo[/eluser]
Come on guys - Someone have ANY ideas!!?? Please!
|