Forum
Perch 3 CSS missing
I've finally found some time to upgrade my first site to Perch 3 and it all looks very nice indeed! One thing I'm struggling with is my site's styling though…
The missing code is the perch_get_css();
call in my <head>
. In v2 the following worked fine:
<?php
PerchSystem::register_feather('tempertemper');
class PerchFeather_tempertemper extends PerchFeather
{
public function get_css($opts, $index, $count)
{
$out = array();
if (!$this->component_registered('style')) {
$version = filemtime($_SERVER['DOCUMENT_ROOT'].'/cms/addons/feathers/tempertemper/css/style.css');
$out[] = $this->_single_tag('link', array(
'rel'=>'stylesheet',
'href'=>$this->path.'/css/style.css?v='.$version
));
$this->register_component('style');
}
if (!$this->component_registered('html5shiv')) {
$out[] = $this->_script_tag(array(
'src'=>$this->path.'/js/html5shiv.min.js'
));
$this->register_component('html5shiv');
}
if (!$this->component_registered('responsive-nav')) {
$out[] = $this->_script_tag(array(
'src'=>$this->path.'/js/responsive-nav.min.js'
));
$this->register_component('responsive-nav');
}
return implode("\n\t", $out)."\n";
}
public function get_javascript($opts, $index, $count)
{
$out = array();
if (!$this->component_registered('jquery')) {
$out[] = $this->_script_tag(array(
'src'=>$this->path.'/js/production.min.js'
));
$this->register_component('jquery');
}
return implode("\n\t", $out)."\n";
}
}
But the chunk of code that was outputting is now missing completely from my document.
Here are my diagnostics, in case that's helpful:
Perch Runway: 3.0.1, PHP: 7.0.13, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (3.0.1), assets (3.0.1), categories (3.0.1), perch_blog (5.5.1), perch_forms (1.9)
App runtimes: <?php $apps_list = [ 'content', 'categories', 'perch_blog', 'perch_forms', ];
PERCH_LOGINPATH: /cms
PERCH_PATH: /Users/TemperTemper/Sites/tempertemper/web/cms
PERCH_CORE: /Users/TemperTemper/Sites/tempertemper/web/cms/core
PERCH_RESFILEPATH: /Users/TemperTemper/Sites/tempertemper/web/cms/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: tempertemper.local
DOCUMENT_ROOT: /Users/TemperTemper/Sites/tempertemper/web
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Have you included your feather in
perch/config/feathers.php
?https://docs.grabaperch.com/addons/feathers/
You also should remove the content and categories apps from apps.php https://docs.grabaperch.com/runway/upgrading/
This is my feathers config:
I've removed the content and categories items from my apps.php, which now looks like this:
Otherwise, everything is as per the upgrade instructions… Probably something daft I'm missing, but I can't think what.
My runway file looks like this:
Core has been swapped out and I've taken /markitup/ out of the addons/plugins/editors/ directory.
Have you turned Feathers on?
I hadn't! Done it now and it's working – thanks!
Is that a new option? Or maybe it was just implicit in Perch 2.
It's new, Feathers isn't widely used so we turn it off by default to make things faster.
Makes sense. Thanks for the help :)
Hi All,
I have the same issue, where do i have to turn feathers on as i think that is my issue.
Thanks
Hey Roberto, if you drop
define('PERCH_FEATHERS', true);
into perch/config/config.php that'll do the trick :)Hi Martin, Thank you!