Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-04-24 10:31:36

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Same form on many domains

Hello,

I want to use the same pages, forms or CSS on 3 domains/sites.

site1.xxx is the master site (with the original pages, forms + css )

I want to call and insert these snipets on site2.xxx and site3.xxx, from the site1.xxx, (without do a simple copy/paste).

Any idea, with core components, plugins or PHP ?

Thanks … !

Offline

#2 2016-04-24 12:25:52

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Same form on many domains

Hi Jean-Pol,

if db are stored on the same host, with same login, this (called on site2) should work:

<txp:etc_query data="SELECT Form FROM txp_form WHERE name='something'" url="your_db1" markup="db" />

Just mind that eventual txp tags will be processed in the context of the calling site2.

If db are on different hosts/credentials, drop me a word, so I can amend etc_query.

Offline

#3 2016-04-24 13:05:36

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: Same form on many domains

Hi JP

You can use rah_external_output.

Offline

#4 2016-04-24 15:57:52

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: Same form on many domains

Thanks, etc and Dragondz !

@etc : db are on differents host.

@Dragondz : I’ll try tomorow.

Offline

#5 2016-04-26 18:23:17

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Same form on many domains

You could use rah_flat to manage forms & pages from plain text files.

This way, if all the websites are hosted on the same server, you can configure rah_flat to look for pages & forms from the same folder (ie: /home/sites/shared-assets/).
And if websites are hosted on different servers, you could try this: store them on the “master” server, and access them via a mount (it could be mounted via sshfs, or nfs, or whatever you could use to mount a remote file system). If mounting is not possible, maybe you could setup some cron/rsync job that periodically copies the files from “master” server to the other servers.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2016-04-26 18:51:11

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: Same form on many domains

@maniqui : thanks.

I try rah_external-output and that work.

Offline

Board footer

Powered by FluxBB