We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Possible to share templates between sites?

How Do I?

User 12uuy7p7W's avatar
User 12uuy7p7W
7 posts
about 3 months ago
User 12uuy7p7W's avatar User 12uuy7p7W

2 EE Sites on the same domain Is it possible to embed a Template from Site 1 into Site 2, if they are on the same domain? I know MSM would achieve this, but I’m guessing it’s not achievable if they are separate installations?

       
Bryan's avatar
Bryan
19 posts
about 3 months ago
Bryan's avatar Bryan

I think that would be possible if you symlinked the template or template group from site1 into site2? It should just look like a template in site2 at that point 🤔

       
User 12uuy7p7W's avatar
User 12uuy7p7W
7 posts
about 3 months ago
User 12uuy7p7W's avatar User 12uuy7p7W

Adding new word to my brain: “symlink” 😉

       
User 12uuy7p7W's avatar
User 12uuy7p7W
7 posts
about 3 months ago
User 12uuy7p7W's avatar User 12uuy7p7W

How do I achieve this method?

       
Bryan's avatar
Bryan
19 posts
about 3 months ago
Bryan's avatar Bryan

Haha sorry it’s short for symbolic link, I’m not sure if hosting control panels give you an easier way to do it but the command isn’t too tricky. It looks like this ln -s /path/to/source/file.php /path/to/link/file.php so you might have ln -s /var/www/site1/system/user/templates/test.group/template.html /var/www/site2/system/user/templates/site1templates.group/template.html

       
User 12uuy7p7W's avatar
User 12uuy7p7W
7 posts
about 3 months ago
User 12uuy7p7W's avatar User 12uuy7p7W

I see, interesting… I’m on Shared Hosting (cPanel) so I suspect this isn’t something I’d have access to… but I could drop the tech support guys a note. :slightlysmilingface:

       
User 12uuy7p7W's avatar
User 12uuy7p7W
7 posts
about 3 months ago
User 12uuy7p7W's avatar User 12uuy7p7W

Okay I see the “symlink” php function is automatically disabled in my PHP config settings… so I’m now wondering it it might be possible to use it, if I enable it.

       
Bryan's avatar
Bryan
19 posts
about 3 months ago
Bryan's avatar Bryan

I think that’s just your ability to create symlinks through php https://www.php.net/manual/en/function.symlink.php but the host may have disabled the ability to “follow symlinks” on the webserver which would defeat this approach. It’s worth asking them though, maybe they can do this for you :slightlysmilingface:

       
User 12uuy7p7W's avatar
User 12uuy7p7W
7 posts
about 3 months ago
User 12uuy7p7W's avatar User 12uuy7p7W

Ahhh I see. I’ve dropped them a ticket, so we’ll see what they say. Thanks Bryan. #legend

       
Bryan's avatar
Bryan
19 posts
about 3 months ago
Bryan's avatar Bryan

You bet, let us know how it turns out!

       
User 12uuy7p7W's avatar
User 12uuy7p7W
7 posts
about 3 months ago
User 12uuy7p7W's avatar User 12uuy7p7W

So my hosting provider seems to think it would be possible… “We do support the use of symlinks, but not sure if what you are requesting would be possible, you would need to run this past a developer, we can enable SSH on the cpanel for you.”

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.