how to Install Page Type
Permalink 1 user found helpful
I want to create page type via controller.php and below code is working in 5.6...
$ct = CollectionType::getByHandle('home');
if((!is_object($ct)) || ($ct->getCollectionTypeID() < 1)) {
$data['ctHandle'] = 'home';
$data['ctName'] = t('Home');
$hpt = CollectionType::add($data, $pkg);
}
What do i do for 5.7
$ct = CollectionType::getByHandle('home');
if((!is_object($ct)) || ($ct->getCollectionTypeID() < 1)) {
$data['ctHandle'] = 'home';
$data['ctName'] = t('Home');
$hpt = CollectionType::add($data, $pkg);
}
What do i do for 5.7
+1 - was about to ask this same question actually. Additionally, is there any further documentation on how to setup controllers for theme pages types, and what the relationship is with Templates in 5.7?
Don't know if its perfect but it works:
https://github.com/core77/foundation_sites/blob/master/controller.ph...
https://github.com/core77/foundation_sites/blob/master/controller.ph...
@core77,
You're the man - thanks for linking to your package. Looks well written, and helpful for navigating some of the new 5.7 changes.
You're the man - thanks for linking to your package. Looks well written, and helpful for navigating some of the new 5.7 changes.
Sorry for late reply but it works for me.
Thanks a lot
Thanks a lot
Hey guys. I figured out that page types, which are installed from my foundation_sites package, can't be used until you go to the dashboard and set the publish method.
How can we set the publish method for the page types in the package controller?
How can we set the publish method for the page types in the package controller?
Created a GIST with the code to so in controller.php:
https://gist.github.com/jhartman86/e2a279a5d8a4edca2442...
Line ~105 is where it comes into play. Also, you have to include the proper 'use' statement in the header.
Lmk if that helps.
Next question - anyone figured out how to setup pagetype controllers?
https://gist.github.com/jhartman86/e2a279a5d8a4edca2442...
Line ~105 is where it comes into play. Also, you have to include the proper 'use' statement in the header.
Lmk if that helps.
Next question - anyone figured out how to setup pagetype controllers?
Nice. It helped :-)
Thanks!
Thanks!
Thanks Focus. That Gist worked a treat.
For others that might check this post in the future, here's a more complete package for reference:https://github.com/jhartman86/concrete5-5.7.0/tree/sequence/web/pack...
Deals with custom routes (replacing old Tools files), attributes, file sets, templates, and more robust setup of page types.
Deals with custom routes (replacing old Tools files), attributes, file sets, templates, and more robust setup of page types.