<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,15 +1,38 @@
 class IndexPage &lt; Page 
-  
+
+  #
+  # The Index Page type redirects to the first published child
+  #
   def render
+
     published_children = children.delete_if{|c| c.status_id != 100 }
+
     if !published_children.empty?
-      if defined?(SiteLanguage)  &amp;&amp; SiteLanguage.count &gt; 0
-        response.redirect &quot;/#{params[:language]||I18n.code.to_s}#{published_children.first.url}&quot;, &quot;302 Found&quot;
+
+      if Radiant::Config[&quot;index.page&quot;] &amp;&amp; Radiant::Config[&quot;index.page&quot;] == 'include'
+
+        # Just render the first published child under the parents url
+        published_children.first.render
+
       else
-        response.redirect published_children.first.url, &quot;302 Found&quot;
+
+        # Prefix url with the site language?
+        if defined?(SiteLanguage)  &amp;&amp; SiteLanguage.count &gt; 0
+          redirect_url = (params[:language] || I18n.code.to_s) + published_children.first.url
+        else
+          redirect_url = published_children.first.url
+        end
+
+        # Redirect to a published child page
+        response.headers['Refresh'] = &quot;0; url=#{redirect_url}&quot;
+        ''
       end
+
     else
+
+      # No published children found, so render the page itself
       super
+
     end
   end
   </diff>
      <filename>app/models/index_page.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8ed48440a8427f4f9bfad5d26c89cdcbcae6fbb5</id>
    </parent>
  </parents>
  <author>
    <name>Michael Kessler</name>
    <email>michael.kessler@screenconcept.ch</email>
  </author>
  <url>http://github.com/jomz/radiant-index-page-extension/commit/de327f0ac4e98dcb706024c8c47c83441847fabe</url>
  <id>de327f0ac4e98dcb706024c8c47c83441847fabe</id>
  <committed-date>2009-07-15T08:20:23-07:00</committed-date>
  <authored-date>2009-07-15T08:20:23-07:00</authored-date>
  <message>Make work with Radiant 0.8.0 and add the possiblity to include a page instead of redirecting</message>
  <tree>8f0e9207514350c14d98bc91d8050851f8b3e230</tree>
  <committer>
    <name>Michael Kessler</name>
    <email>michael.kessler@screenconcept.ch</email>
  </committer>
</commit>
