0

I"m setting up an xml template on an old site to use for importing to a new site via datagrab. Everything is working fine except when I try to output categories from one specific category group. When I do that the page gives a 500 error.

Here is the relevant part of my template

<root>
{exp:channel:entries channel="trips" paginate="bottom" status="Open|Closed" limit="500" dynamic="off"}
    <entry>

        <categories>

        {!-- // causes 500 error on page load not sure why
            <cat_activities>
                {categories show_group="6" backspace="1"}
                    <![CDATA[{category_name}]]>,
                {/categories}
            </cat_activities>
        --}


            <cat_difficulty-class>
                {categories show_group="7" backspace="1"}
                    <![CDATA[{category_name}]]>,
                {/categories}
            </cat_difficulty-class>

        </categories>

    </entry>
{/exp:channel:entries}
</root>

I've taken the same code and put it into a test html template and there are no errors and it outputs the categories as expected. See below:

{exp:channel:entries channel="trips" paginate="bottom" status="Open|Closed" limit="500" dynamic="off"}

            <cat_activities>
                {categories show_group="6" backspace="1"}
                    {category_name},<br>
                {/categories}
            </cat_activities>

            <cat_difficulty-class>
                {categories show_group="7" backspace="1"}
                    {category_name},<br>
                {/categories}
            </cat_difficulty-class>

{/exp:channel:entries}

Any idea on why the xml template is getting a 500 error? As soon as I comment out the one category group the xml template loads correctly.

***********UPDATE***************

I also checked that the categories in this category group don't have any special characters or anything that would obviously affect output in either the title or url_title. Have attached screenshot of categories.

enter image description here

2

Can’t see any problem off hand, but I’d try some of this:

  • According to the docs, the backspace parameter counts
    as four characters, so change the backspace value to 4.
  • Removing the <br>
  • Removing the backspace parameter
  • Ensure that category group is indeed assigned to the ‘trips’ channel
  • Try putting group 6 after group 7 and see if the same thing happens
| improve this answer | |
  • Putting group 6 after group 7 resolved this. Thank you. – CreateSean Nov 20 '15 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.