Forums / Setup & design / Is nested switch case possible

Is nested switch case possible

Author Message

James Ward

Tuesday 29 March 2005 12:25:08 pm

The following code does not work the error message complains about unterminated case. Using 3.5.0.

{switch match=$module_result.section_id}
  {case match=5}
    {switch match=$module_result.node_id}
      {case match=66}
        {* do nothing *}
      {/case}
      {case}
        {include uri="design:gutter/staff.tpl"}
      (/case}
    {/switch}
    {include uri="design:gutter/newsletter.tpl"}
  {/case}
  {case}
    {* do nothing *}
  {/case}
{/switch}

Maybe this is not even possible and I should be looking to do this another way. Thanks in advance.

working at www.wardnet.com
blogging at www.jamesward.ca

Ɓukasz Serwatka

Tuesday 29 March 2005 10:07:41 pm

Hi James,

During development it`s good to have debug enabled. Shows all errors,lines numbers, etc.

In site.ini.append.php

[DebugSettings]
DebugOutput=enabled

In your code is parse error:

{switch match=$module_result.section_id}
  {case match=5}
    {switch match=$module_result.node_id}
      {case match=66}
        {* do nothing *}
      {/case}
      {case}
        {include uri="design:gutter/staff.tpl"}
      {/case} <-- here was ( instead of { ;-)
    {/switch}
    {include uri="design:gutter/newsletter.tpl"}
  {/case}
  {case}
    {* do nothing *}
  {/case}
{/switch}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog