Previous Blogs

Tags

 

Additional Blog Entry page type in Concrete5.4.2.2

Posted by Elsabe on January 27, 2012

Today, I was making a bilingual blog in Concrete5 by simply making two versions of the site in the site-map and creating different page types for the second language. (bit of duplication, I know, but its not a very big site). 

In Concrete5 to create a new page_type you simply make a PHP file in your themes directory and add it to the system in the Dashboard. So it follows to create a page_type with the same functionality as the existing blog entry page type, you copy and rename the relevant file. Now, in the theme directory, there is the following two page type views:

/public_html/themes/teh_theme/blog_entry.php
/public_html/themes/teh_theme/afr_blog_entry.php

Everything works 100%, until you try to make a page list using the Blog Index template:

Fatal error: Call to undefined method Controller::getCommentCountString() in 
/public_html/blocks/page_list/templates/blog_index.php on line 17

Turns out the blog entry page type has its own controller with additional functionality to show you comment counts on a blog entry. To fix the error you need to copy the following:

/public_html/concrete/controllers/page_types/blog_entry.php

to:

/public_html/controllers/page_types/afr_blog_entry.php

Refresh on the page containing the Blog Index and the problem is solved.

Additional resources:

Tags

  • Concrete 5

Comments:

Leave a Reply



(Your email will not be publicly displayed.)

Please type the letters and numbers shown in the image.Captcha CodeClick the image to see another captcha.