Search code examples
kentico

Kentico V9 Calender/Event page types


I'm using the base Event calendar as a starting point and we've noticed something strange. As we know, each event becomes it's own page. My Event Title filed becomes the page URL. What we've seen is, if there is an underscore in the event title, The event details do not render as the should.

If i manually changes the page URL from an underscore to a hyphen, the details render correctly.

Adding a hyphen to the Event Title seems to be the issue.

To help trouble shoot this, what's needed from me?

This is my transformation code:

<section id="eventDetail">
  <h1><%# Eval("EventTitle") %></h1>
  <h2><%# CMS.Helpers.ResHelper.GetString("kff.Generic-From")%>:</h2>
  <p><%# FormatDateTime(Eval("EventStart"),"dddd, MMMM d, yyyy h:mm tt") %></p>
  <h2><%# CMS.Helpers.ResHelper.GetString("kff.Generic-To")%>:</h2>
  <p><%# FormatDateTime(Eval("EventEnd"),"dddd, MMMM d, yyyy h:mm tt") %></p>
  <h2><%# CMS.Helpers.ResHelper.GetString("kff.Generic-Location")%>:</h2>
  <p><%# Eval("EventLocation") %></p>
  <h2><%# CMS.Helpers.ResHelper.GetString("kff.Generic-Details")%>:</h2>
  <p><%# Eval("EventDescription") %></p>
  
  
</section>

I've added screen shots of the rendered pages.

Event example - not working Event example - working


Solution

  • If you're having issues with underscores in names, then just add the underscore to the list of forbidden characters to rewrite in Settings>URLs & SEO? No need to wait for an upgrade or a hotfix, just resolve it yourself.