0

If the seg_to_cat can't be analyzed, (the category doesn't exist), the resulting page shows all the entries in the channel. What can be done to show instead a "no results found" page?

1 Answer 1

1

You can conditionally check your segment variables from the extension:

{if segment_2_category_name}

    This category exists.

    {exp:channel:entries category="{segment_2_category_id}"}
        ...{title}...
    {/exp:channel:entries}

{if:else}

    No results code, or {redirect="404"}

{/if}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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