0

I am attempting to display a message when the last segment equals "success"... I've done this many times before and for some reason I am having some trouble. I need an extra eye perhaps?

Below is my code. The url upon submission redirects and looks like this: http://site.dev/events/event_submission/success/

However, the third segment isn't being read by EE because {last_segment} equals "event_submission" and {segment_3} parses blank.

{exp:switchee variable="global:member_group" parse_tags="yes" parse="inward"}

    {case value="1"}
        {if last_segment == 'success'}
            Your event has been submitted. You will receive notification when your event has been approved or rejected. You can <a href="{path=logout}">logout</a> now or <a href="{site_url}events/event_submission">click here</a> to create another event.
        {if:else}
        {exp:channel:form channel="events_submitted" id="publishForm" return="events/event_submission/success" json="yes" include_jquery="no"}
            "Just to test: {last_segment} {segment_3}"
            <p>Welcome back, <strong>{screen_name}</strong>!</p>

I am sure I am just having a coding block but I cannot get it going... any tips?

5
  • Do you have structure or freebie addons installed at all?
    – SyA
    Aug 5 '14 at 23:15
  • I do have Structure installed but it doesn't manage this channel... Aug 6 '14 at 16:06
  • 1
    My only thought is that you may have freebie installed, which is a useful extension for structure. By default it makes success|error|preview in the segments "EE will act as if these segments aren’t in the URI at all". Check to see if you have this installed, in which case use {freebie_3} to catch that segment (Freebie will work regardless of the channel used for structure). Or you could try changing "success" segment to something else like "thankyou".
    – SyA
    Aug 6 '14 at 16:49
  • You were right. We had Freebie installed for a feature we never used. But it was the culprit. Thanks! Make an answer and Ill mark it correct. Aug 6 '14 at 17:14
  • Good to hear. Just another one of those things to watch out for.
    – SyA
    Aug 6 '14 at 17:24
0

My only thought is that you may have freebie installed, which is a useful extension for structure. By default it makes success|error|preview in the segments "EE will act as if these segments aren’t in the URI at all". Check to see if you have this installed, in which case use {freebie_3} to catch that segment (Freebie will work regardless of the channel used for structure). Or you could try changing "success" segment to something else like "thankyou".

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.