Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-11-10 02:55:02
- etimbo
- New Member
- Registered: 2005-11-10
- Posts: 3
Integrating TextPattern into PHP
Hello, first of all thanks to everyone who makes textpattern possible. I like what i see :)
Now I just have a little question for the textpattern savy about if there is any way to integrate textpattern functions into the middle of my php pages.
I am currently developing quite a large and dynamic site and I want to use Textpattern to manage the FAQ, News and Help Sections of the site. They will be almost entirely standalone and wont need any of the classes and functions the site uses.
And for that job it looks like its going to do a great job, but I also want to include parts of the news and help throughout the site. Because I am using smarty templates and my own apache redirects for search engine friendly urls and so on I can’t hand over everything to textpattern or any other CMS.
Now that I have hurt my brain thinking to hard, is there anyway I can include some of the textpattern wonder within my own templates and php?
I was thinking something along the lines of:
require (‘textpattern.php’);
$textpattern = new textPattern_class;
and then in the middle of different pages i do things like
$textpattern->passtemplate(‘indexNews.tpl’); //would parse indexNews.tpl through textpattern (indexNews is the latest news article links)
$textpattern->passtemplate(‘loginHelp.tpl’);
I hope I have made sence. Any help would be wonderful :)
Offline
Re: Integrating TextPattern into PHP
From several past experiences here on the forums, I suggest you do this the other way around.
Offline
#3 2005-11-10 03:13:53
- etimbo
- New Member
- Registered: 2005-11-10
- Posts: 3
Re: Integrating TextPattern into PHP
> Jeremie wrote:
> From several past experiences here on the forums, I suggest you do this the other way around.
:( I dont think im going to be able to as there are areas like myaccount where create listings on the site (its sort of like a trading post)
I wanted to put in relevent help articles on each of the pages. Like if a seller was replying to a buyer it would show the links to the relevent help section (which would be entirely textpattern in its own directory).
Thanks though.
Offline
#4 2005-11-10 03:30:32
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Integrating TextPattern into PHP
Textpattern is designed for building and managing web sites, not as a library for integrating into other applications.
This is covered in the FAQ.
Alex
Offline
#5 2005-11-10 03:39:34
- etimbo
- New Member
- Registered: 2005-11-10
- Posts: 3
Re: Integrating TextPattern into PHP
> zem wrote:
> Textpattern is designed for building and managing web sites, not as a library for integrating into other applications.
>This is covered in the FAQ.
Thanks for that mate, I thought it was too hard :P
Looks like i will have to take what i had in mind down a notch… simply have a generic link to help throughout the site and for the main page with the news bit i’ll try a textpattern template on for size as it doesnt have too many dynamic bits…. just forms which all post to another page.
EDIT: yah, definately cant embed my functions and php within the textpattern templates as they include redirects and use pear::error_stack.
EDIT: bugger, I cant use it on the main page either, forms have validation.
Last edited by etimbo (2005-11-10 03:52:57)
Offline
Re: Integrating TextPattern into PHP
zem: in that FAQ item, shouldn’t it say “HTTP headers” instead of “HTML headers”?
You cooin’ with my bird?
Offline
#7 2005-11-10 22:01:47
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Integrating TextPattern into PHP
Thanks, fixed.
Alex
Offline
Pages: 1