Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-05 21:07:51

snkupo
New Member
Registered: 2005-12-05
Posts: 4

Include textpattern

Hi there.

I’ve got a site on my local computer. It started out as http://capc0m.frac.dk/ , so the design is basically the same. I’ve installed textpattern in a subfolder called “textpattern”. “Textpattern” is located in the same folder as my index.php file for my website. So.. how do I include textpatter so that it is visible in <div id=“main”> ? That is the middle of the page.

What code must I use? I’ve tried quite a few things, but I always seem to end up with an error saying something about the header. I haven’t really found out how to include the page, so I guess that is what is the problem really.

Do I have the change some settings maybe becasue I am going to use in in my div id “main?”. It works great when I preview from textpattern itself (previewing only textpattern site, not with my menu, main as at capc0m.frac.dk/).

What should I do to include the page? what code?

Offline

#2 2005-12-05 21:52:39

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Include textpattern

Well, technically you can’t use Textpattern to do that. In practice, I’ve found that there are ways to make it work:

http://forum.textpattern.com/viewtopic.php?id=12968
http://forum.textpattern.com/viewtopic.php?pid=75249#p75249

-Kurt


kurt@kurtraschke.com

Offline

#3 2005-12-05 21:59:11

snkupo
New Member
Registered: 2005-12-05
Posts: 4

Re: Include textpattern

I see.
Do you know of another solution for me then?
So that I can use somthing similar to textpattern to add news? I’m looking to make news similar to sites like one has http://www.smrpglegacy.com/v3.jpg . I guess that one hant been coded from scratch either. The news system, I mean.

Offline

#4 2005-12-05 22:08:54

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Include textpattern

Well, as I said, it is possible to include Textpattern in the fashion you’re describing. But, if you want something specifically built for the purpose, then you may have to write it yourself.

-Kurt


kurt@kurtraschke.com

Offline

#5 2005-12-05 22:28:27

snkupo
New Member
Registered: 2005-12-05
Posts: 4

Re: Include textpattern

But it can’t be the way that it’s not possible to view scripts like textpattern in a specifig .php file (in my case the middle of the page) ? Almost all php pages have several .php files viewed at once :S . Take for example the link I posted; http://www.smrpglegacy.com/v3.jpg – then how is that page built? It sure is using a newsscript. It has to be with several .php files viewed at ocne, like the one I’m doing (capc0m.frac.dk/) ?

Offline

#6 2005-12-05 22:43:13

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Include textpattern

This is covered in the FAQ. Trying to include Textpattern inside another page or script doesn’t work well because that’s not how Textpattern is designed to work. Square peg, round hole.

On the other hand, it’s quite easy to include other elements – PHP, static content – inside a Textpattern page. You’ll find documentation links in the posts at the top of this forum.


Alex

Offline

#7 2005-12-06 05:43:56

snkupo
New Member
Registered: 2005-12-05
Posts: 4

Re: Include textpattern

Thanks.

I’ll try.

Offline

#8 2005-12-06 16:28:23

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Include textpattern

Trying to include Textpattern inside another page or script doesn’t work well because that’s not how Textpattern is designed to work. Square peg, round hole.

But it certainly is technically feasible…I’ve done it before, and I’ve seen others on this forum get it to work. Admittedly, there are issues with the default publish.php producing HTTP headers, but even that can be worked around fairly easily.

There certainly seem to be plenty of people who want to show TXP content on external pages, so why not provide an officially-sanctioned way to do it? Why is the default response always “You shouldn’t want to do that, and anyway, Textpattern doesn’t work like that”? If someone has an existing PHP-based site, and they want to extract data from their Textpattern site and display it on outside pages, why shouldn’t they be able to? It’s just a matter of calling <code>parse()</code>.

I know it’s fragile, and I know that some things may not work in that environment, but for people who are determined to show TXP content on external PHP pages, why not? I think an unsupported solution with a large bold disclaimer is better than no solution at all.

http://forum.textpattern.com/viewtopic.php?id=12968

-Kurt

Last edited by KurtRaschke (2005-12-06 16:32:43)


kurt@kurtraschke.com

Offline

#9 2005-12-07 05:22:34

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Include textpattern

…so why not provide an officially-sanctioned way to do it?

You answered your own question:

I know it’s fragile, and I know that some things may not work in that environment, but for people who are determined to show TXP content on external PHP pages, why not? I think an unsupported solution with a large bold disclaimer is better than no solution at all.

Restated: because then users would also want existing tags (like permlink) and other behaviours to work as usual, which may or may not once you do that. Keeping it as an unofficial add-on means that users won’t expect which shouldn’t be expected: official support for a hack (a nice hack, or call it “mod”, but it’s still a hack). :)

Offline

#10 2005-12-07 21:47:48

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Include textpattern

There certainly seem to be plenty of people who want to show TXP content on external pages, so why not provide an officially-sanctioned way to do it? Why is the default response always “You shouldn’t want to do that, and anyway, Textpattern doesn’t work like that”?

Same reasons that any number of other features don’t get added:

  • The dev team members don’t need or want that feature, and nobody has contracted them to add it.
  • Nobody has submitted a patch. Code trumps all else.
  • Each new feature or configuration decision increases the support load and the number of steps required to diagnose problems; this one is certainly not trivial (and as anyone who reads the forum regularly knows, people ignore FAQs, docs and disclaimers)
  • Keeping things small, leaving things out, and concentrating on doing a limited range of things well, is what keeps txp maintainable. There are only so many things we can deal with at a time. Restraint matters.

Alex

Offline

Board footer

Powered by FluxBB