Mutli Site setup just for templates

Hi all -

I’m wanting to create a specific version of a site I’m working on for a public touchscreen, and was wondering if could use the multisite setup, but just for the ‘templates’ folder.

I’ve tried using the example code in the docs but not much luck.

I’ve set up the sub domain expo.domain.com and if someone visits this i want the normal kirby install to be shown but with the second version of the templates folder.

Doing this and not just the site folder means all blueprints etc are kept central and it’s just the template which needs duplicating.

Thanks!

I load css and javascript based on domain name, and you can do the same with snippets.

In your config:

c::set('touchscreen', 'expo.domain.com');

in a snippet or template file:

<?php
$pageurl = $_SERVER['HTTP_HOST'];
if (strstr($pageurl, c::get('touchscreen'))) {
// touchscreen code
} else {
// normal site code 
}

or:

<?php 
$pageurl = $_SERVER['HTTP_HOST'];
if (strstr($pageurl, c::get('touchscreen'): ?>

<!-- touchscreen code -->

<?php else: ?>

<!-- normal site code -->

<?php endif ?>

Keep in mind that subfolders work with snippets, so you for instance if you had a snippets folder like:

snippets/public
snippets/touchscreen

then these will work:

<?php snippet('touchscreen/yoursnippet') ?>
<?php snippet('public/yoursnippet') ?>

@dilby Did you try to get it to work with different site folders? I would expect the multi-site setup to work with only different template folders as well.