4 replies to this topic
#1
Posted 23 May 2012 - 03:51 AM
Hi guys,
I have been playing around with multisite recently and wondered - what would be the best way to share some template logic between multisite instances?
I have an upcoming project where two different sites would have different users and setups etc but they need to share some basic similarities in look and functionality. I was thinking of setting up the sites as separate sites under multisite and then finding a way of sharing something such as a 'main.php' file that each template calls. I would also like to share a 'base.css' file between the sites as well. I want to do things this way because they want the potential to be able to expand into more sites over time - up to 5 or so.
What would be the best way of doing this?
Thanks in advance.
I have been playing around with multisite recently and wondered - what would be the best way to share some template logic between multisite instances?
I have an upcoming project where two different sites would have different users and setups etc but they need to share some basic similarities in look and functionality. I was thinking of setting up the sites as separate sites under multisite and then finding a way of sharing something such as a 'main.php' file that each template calls. I would also like to share a 'base.css' file between the sites as well. I want to do things this way because they want the potential to be able to expand into more sites over time - up to 5 or so.
What would be the best way of doing this?
Thanks in advance.
#2
Posted 23 May 2012 - 03:53 AM
If you can I would use symlinks to have one set of templates and link folder or single files to the local site.
@somartist | modules created | support me, flattr my work flattr.com
#4
Posted 24 May 2012 - 10:13 AM
You can use symlinks, but I also don't see any problem with just referencing the file you want directly. I'm not sure which multi site method you are using, but assuming you are using the built-in method with multiple site- directories. So if you want to include your /site-other/templates/home.php to include /site/templates/main.php, then you would just do this in your home.php:
Likewise for your base.css file, except that you would use a URL instead:
include($config->paths->root . 'site/templates/main.php');
Likewise for your base.css file, except that you would use a URL instead:
<link rel='stylesheet' type='text/css' href='<?=$config->urls->root?>site/templates/styles/base.css' />
Also tagged with one or more of these keywords: templates, multisite
Community Support →
General Support →
One ProcessWire-installation folder for multiple sites (without symbolic links)Started by SwimToWin, 12 May 2013 |
|
|
||
Community Support →
General Support →
Multisite install login problem?Started by photoman355, 09 Apr 2013 |
|
|
||
Community Support →
General Support →
Templates LabelStarted by kongondo, 05 Apr 2013 |
|
|
||
Community Support →
API & Templates →
Basic navigation by templatesStarted by luckybusted, 18 Mar 2013 |
|
|
||
Community Support →
General Support →
How to create many-to-many relationshipStarted by binitprads, 04 Feb 2013 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













