We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Runway

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
Martin Underhill

Martin Underhill 5 points

  • 2 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

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:

<?php
  include(PERCH_PATH.'/addons/feathers/tempertemper/runtime.php');

I've removed the content and categories items from my apps.php, which now looks like this:

<?php
  $apps_list = [
    'perch_blog',
    'perch_forms',
  ];

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:

<?php
    return [

        /*
        |--------------------------------------------------------------------------
        | Environment settings
        |--------------------------------------------------------------------------
        |
        | Various file operations (notably moving files to cloud storage) needs a
        | temporary folder to work in. This should be OUTSIDE of the
        | web root, and should be writable by PHP.
        |
        */

        'env' => [

            'temp_folder' => '/tmp',

        ],



        /*
        |--------------------------------------------------------------------------
        | Routing Tokens
        |--------------------------------------------------------------------------
        |
        | URL Routing uses tokens for pattern matching. Custom tokens can be
        | specified as 'token_id' => 'regular expression'.
        | For performance, tokens are converted to regexp at edit time. If you
        | make a change here, re-save the page options for the change to take effect.
        |
        */

        'routing_tokens' => [

        ],

        /*
        |--------------------------------------------------------------------------
        | Amazon S3
        |--------------------------------------------------------------------------
        |
        | Amazon security credentials for accessing S3
        |
        */

        'amazon_s3' => [

            'access_key_id'     => '',
            'secret_access_key' => '',
            'handler'           => 'PerchS3_ResourceBucket',
            'handler_path'      => PERCH_CORE.'/runway/apps/perch_s3/PerchS3_ResourceBucket.class.php',

        ],

        /*
        |--------------------------------------------------------------------------
        | OpenStack Object Storage
        |--------------------------------------------------------------------------
        |
        | Security credentials for accessing OpenStack Object Storage services such
        | as Rackspace Cloud Files.
        |
        */

        'openstack_object_storage' => [

            'username'     => '',
            'password'     => '',
            'tenantid'     => '',
            'endpoint'     => 'https://lon.identity.api.rackspacecloud.com/v2.0',
            'region'       => 'LON',
            'handler'      => 'PerchOpenStack_ResourceBucket',
            'handler_path' => PERCH_CORE.'/runway/apps/perch_openstack/PerchOpenStack_ResourceBucket.class.php',

        ],

        /*
        |--------------------------------------------------------------------------
        | Varnish
        |--------------------------------------------------------------------------
        |
        | Enable support for purging and banning pages from your varnish cache
        |
        */

        'varnish' => [

            'enabled' => false,

        ],

        /*
        |--------------------------------------------------------------------------
        | Search
        |--------------------------------------------------------------------------
        |
        | Configure your search provider and any settings needed for it.
        |
        */

        'search' => [

            'provider' => 'native',

        ],

        /*
        |--------------------------------------------------------------------------
        | Cache
        |--------------------------------------------------------------------------
        |
        | Configure your caching provider and any settings needed for it.
        |
        */

        'cache' => [

            'provider' => 'native',

        ],


    ];

Core has been swapped out and I've taken /markitup/ out of the addons/plugins/editors/ directory.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you turned Feathers on?

define('PERCH_FEATHERS', true);

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.

Drew McLellan

Drew McLellan 2638 points
Perch Support

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!