Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » How do I…?
  3. » php

#1 2015-07-14 11:58:29

pierlu
Member
Registered: 2014-08-12
Posts: 153

php

Come si fa a collegare una pag php a textpattern?

Offline

#2 2015-07-14 12:08:54

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: php

Don’t feed the troll… ;-)

Offline

#3 2015-07-14 15:36:34

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: php

@candyman

Ah, I thought there was someone with questions from a real need … You think he’s a troll?

I’m naive?

Offline

#4 2015-07-14 16:06:55

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: php

pierlu wrote #293160:

Come si fa a collegare una pag php a textpattern?

Translated: How do you connect a php page to textpattern?

Please explain connect?

Offline

#5 2015-07-14 17:20:23

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: php

For the record: pierlu isn’t a troll, he’s searching for help. But the impression might originate, pierlu, because you are disregarding advice you are given, over and over, are ignoring many of the forum rules and are imposing more work on us than you’d have to. I’ll again name some of my points of criticism so you probably get help quicker and more reliably should you heed advice in future.

  • As a first step: Look for yourself whether the docs, especially its tag list, the FAQ or the forum might have an answer for you (the FAQ, e.g., offer two articles on the use of PHP in Textpattern, the tag list page lists txp:php)
  • Translate your posts yourself, each time.
  • Name what you’ve already tried but didn’t work, explain where you encountered difficulties.
  • Describe in more detail what you want to achieve. Try to describe your problem to the totally strange persons we are: We can’t see what you see.
  • Post your code (and format it so it’s displayed as code. Don’t let moderators do it for you.)
  • If you’re working on a website that is online, post a link to the page in question.
  • Ask plugin questions in the respective plugin topic. Almost every plugin has its own topic here, and many people are subscribed to them, so the ones you reach will more likely have experience in using the plugin.
  • And finally: When a user has helped you: Remember to come back and tell him/her so.

Good luck, furthermore!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#6 2015-07-14 18:35:50

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

Re: php

uli wrote #293178:

And finally: When a user has helped you: Remember to come back and tell him/her so.

Yes, please, and this is valid for all of us. People spend their time to find a solution, so at least provide some feedback whether it works or otherwise, for future references.

Offline

#7 2015-07-14 20:01:26

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: php

@uli

Very good resumed.

Offline

#8 2015-07-15 08:09:37

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: php

As Bert (hcgtv) wrote, it depends what you mean by connect.

You can use a php script side-by-side with textpattern by simply placing it in a subdirectory and letting it do its own business. You just need to make sure, you’re not using that directory name as a section in textpattern. That’s not connected to textpattern, just alongside textpattern.

You can include php snippets in page templates by placing it in <txp:php> … your php … </txp:php> tags but be warned, they only operate within that code block. If you need the php-script to work across page reloads or between blocks, you need to store output in a global variable and pick up that global variable in the next code block or store or transmit the output some other way.

If you need the php to interact in some way with the rest of textpattern, you may need to repurpose your php script as a plugin.

Sometimes you can solve it another way: your php script can run on its own in a subdirectory, but you want part of textpattern’s output in its template. For that you can use rah_external_output in textpattern, and then bring that into the other script’s template. An example: years ago, I used to use a separate gallery script that was better at handling lots of images than textpattern. I installed it in a separate directory and styled its template to look the same as the textpattern website. However, I needed certain blocks from textpattern to show in the gallery’s template, e.g. the navigation, and a set of recent articles in the sidebar. That’s where rah_external_output comes in useful.

As the other’s have said, tell us more what you want to do (perhaps with a link the script you want to use) and we can provide better help…


TXP Builders – finely-crafted code, design and txp

Offline

  1. Index
  2. » How do I…?
  3. » php

Board footer

Powered by FluxBB