0

Can I use a Low Events start date in the dynamic title on my channel form?

{exp:channel:form 
    channel="training_sessions"
    return="/mysite/training/announce-training/thank-you"
    error_handling="inline"
    secure_action="yes"
    dynamic_title="Training [training_event_details:start_date format="%Y%m%d"] [training_site_city] [training_site_state]"
}

This isn't working. I also tried removing the format="%Y%m%d" bit and it still doesn't work.

{exp:channel:form 
    channel="training_sessions"
    return="/mysite/training/announce-training/thank-you"
    error_handling="inline"
    secure_action="yes"
    dynamic_title="Training [training_event_details:start_date] [training_site_city] [training_site_state]"
}

The generated dynamic title looks like Training [training_event_details:start_date] Minneapolis MN instead of the desired Training 20150131 Minneapolis MN.

Can this be done?

2

I took a quick look, and Channel Form's dynamic_title feature is somewhat limited. It simply takes the raw entry data and does a find/replace in the title based on that data. No processing, no support for modifiers or parameters, nor some sort of rule or API to allow for that sort of thing.

That means the Low Events vars, which all use modifiers (like {events_field:start_date}), aren't supported by Channel Form.

Instead, you'd have to use JS to modify a (hidden) title field so you can add the start date to it.

Edit:

Looking at the core code, you should be able fool EE by adding a (hidden) field where you enter the start date (automatically via JS or manually), which you then use in the dynamic_title parameter. For example:

{exp:channel:form ... dynamic_title="Training [foo]"}
    <input type="hidden" name="foo" value="20140120">
{/exp:channel:form}
  • Would it work if I used the entry_date instead (and have Low Events override the entry date)? – Amy Witty Jan 20 '15 at 18:48
  • I doubt it. The [field] needs to be part of the form (or POST, to be precise) if you want to use it in the dynamic_title param. – Low Jan 20 '15 at 18:50
  • Okay, thanks. Guess I will abandon that idea. :-) – Amy Witty Jan 20 '15 at 18:56

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.