Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Problem with Multisite Streams

Started by Muut Archive 10 years ago · 1 replies · 378 views
10 years ago

Hey there,
is it possible to create a stream with the "accounts" folder?
With my actual setup.php it won't work:

<?php
/**

  • Multisite setup for subsites accessible via sub-domains.
  • DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING!
    */

use Grav\Common\Utils;

// Get subsite name from sub-domain
$environment = isset($_SERVER['HTTP_HOST'])
? $_SERVER['HTTP_HOST']
: (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost');
// Remove port from HTTP_HOST generated $environment
$environment = strtolower(Utils::substrToString($environment, ':'));
$folder = "sites/{$environment}";

if ($environment === 'localhost' || !is_dir(ROOT_DIR . "user/{$folder}")) {
return [];
}

return [
'environment' => $environment,
'streams' => [
'schemes' => [
'themes' => [
'type' => 'ReadOnlyStream',
'prefixes' => [
'' => ["user/themes"],
]
],

JS
        'accounts' => [
           'type' => 'Stream',
           'prefixes' => [
               '' => ["user/accounts"],
           ]
        ],

        'plugins' => [
           'type' => 'Stream',
           'prefixes' => [
               '' => ["user/plugins"],
           ]
        ],

        'accounts' => [
           'type' => 'Stream',
           'prefixes' => [
               '' => ["user/accounts"],
           ]
        ],

        'user' => [
            'type' => 'ReadOnlyStream',
            'prefixes' => [
                '' => ["user/{$folder}"],
            ]
        ],

    ]
]

];

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1367 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago