Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How to use forms and css from another TXP Database
Hi, I want to set up a website, consisting of several different project websites maintained (contentwise) by different people. However, I do want them all to look the same, so basically have them use the same forms and css.
Although copy paste is possible, it is not the most efficient way of synchronizing forms and css. Ideally I would like to have one master page where I can edit forms and css, which are subsequently automatically used by the other subwebsites.
The websites will be using one TXP install but each will have there own database. (masterpage.mydomain.com / project1.mydomain.com / project2.mydomain.com)
Also, I don’t want them to blindly import ALL forms or page structures from the master page, as some projects might be slightly different or have different types of content. So Ideally I would simply want to have simple code like:
<txp:output_form form=“default_header” />
but instead of loading the form from the current database, the form is loaded from the master database.
This would allow me to manage different pages at once, to have them use largely the same forms, but gives me the freedom to let some pages use different forms on occasion if necessary.
Suggestions anyone?
Offline
Re: How to use forms and css from another TXP Database
css is easy, just call it from the one of the dbs
I would use rah_external in one of the installs to synchronise the forms.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: How to use forms and css from another TXP Database
I guess it depends on the degree of similarity. Thinking aloud:
- If they are almost identical except for some domain-specific differences, you might want to use one install and just use some conditionals for the different domains, e.g. ied_if_domain.
- Another option might be to use txp’s multi-site setup (e.g. one installation), cnk_versioning for storing forms and page templates as files (instead of via the presentations tab). You could then, if your host provides you with sufficient access rights, use symlinks to reference the same set of form and templates from each install.
- Other simpler options for referencing content from one domain in another is to use rah_external_output as Yiannis mentions, and/or an rss-feed from one installation that is read in with bit_rss (or smd_xml or similar) in another installation.
TXP Builders – finely-crafted code, design and txp
Offline
Re: How to use forms and css from another TXP Database
jakob wrote:
Another option might be to use txp’s multi-site setup (e.g. one installation), cnk_versioning for storing forms and page templates as files (instead of via the presentations tab). You could then, if your host provides you with sufficient access rights, use symlinks to reference the same set of form and templates from each install.
sidekarsten, I’ll go with this suggestion by jakob. In fact, I did it for a project that used a few TXP installs and shared all pages & forms.
May be a bit trick (not too much) to setup properly if you don’t know yet cnk_versioning and txp’s multi-site setup.
But once it’s in place you will have what you are trying to achieve (if I properly understood your request, he).
For setting this up, I suggest you that you store the pages & forms, in some common folder (i.e. /home/sites/super-txp-project/common/forms/
, /home/sites/super-txp-project/common/pages/
), and then, on each project (project1, project2), you also create two folders (/home/sites/super-txp-project/textpattern/sites/projectA/admin/forms/
& /home/sites/super-txp-project/textpattern/sites/projectA/admin/pages
, and so on for each project).
On those folders, you can:
- create symlinks to each particular form & page (located on the “common” folders), that you will like to add to that project.
- create new pages & forms for that particular project
The advantage of creating this two folders (instead of fully symlinking them, which will bring all pages & forms to a particular project) is that it lets you just symlink only those pages & forms that you need, and even better, override them (by just simple creating the page or form at a project level) when you need it. Also, it lets you create other forms & pages only needed for a particular project.
You will want to begin with setting cnk_versioning and understanding how it works…
Offline
Re: How to use forms and css from another TXP Database
BTW, there are other crazy stuff you could do to get a better development environment for this “multiple-sites-but-with-some-stuff-shared” scenario.
In the same way you are sharing pages & forms, you could share plugins saved directed as .php files on a common folder (instead of putting them in the database of each project), and then, symlink them from each particular project. If you need the same plugins in every project, then you could symlink directly this common plugin folder (assuming you don’t store more than one version for each particular plugin, because TXP explodes if you try to load the same plugin twice).
This trick can be taken also to another level, but before doing so, let’s see if you can make your way to this kind of setup :)
Offline
Re: How to use forms and css from another TXP Database
Thanks guys for the tips so far, will go over them and try to see what works best for me!
Cheers
Karsten
Offline