1. <% if ContactForm.Message %>
  2. <div class="row mx-0">
  3. <div class="col-sm-12">
  4. <% if ContactForm.MessageType == 'good' %>
  5. <div class="alert bg-success text-white px-4 py-3" role="alert">
  6. $ContactForm.Message
  7. </div>
  8. <% else %>
  9. <div class="alert bg-danger text-white px-4 py-3" role="alert">
  10. $ContactForm.Message
  11. </div>
  12. <% end_if %>
  13. </div>
  14. </div>
  15. <% end_if %>

it works for me using <% if ContactForm.MessageType == 'good' %> and $ContactForm.Message

I think this ORM + How it all automatically generates the admin bits is what makes me stick with SilverStripe 🙂

I have a lot of Pages with custom fields and no controller 🙂 (edited)

no need for a controller unless you need it for something else (edited)

as far as I know, you create a Page class that extends Page and a template (Layout) with matching name and that template is used with that page