Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2006-05-17 08:11:38

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: another txp tag nesting php query

That’ll take a while to dig through. Hold on…

Offline

#17 2006-05-17 19:20:29

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: another txp tag nesting php query

Suspense is rising. My primary suspect is that line of your page template:

<txp:article_custom form="nav" category="residents" />

Please try to remove it to dis-/approve my thoughts1.

As far as I understand the code of publish.php, a call to article_custom is always considered as a call for an article list, not for a single article. This ain’t no big surprise so far, of course. But, in that case, on the very end of doArticles in publish.php the global array $thisarticle containing your desperately needed title is zapped:

unset($GLOBALS['thisarticle']);

Otherwise I’m stumped again. Phew…

1 If the removal of said line proves to be successful, you can store the current title just before you start to list all residents and use that value instead of title() in the txp:php snippet we built previously. In that case, please try to use this as your page template.

Last edited by wet (2006-05-17 20:59:15)

Offline

#18 2006-05-18 09:42:07

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: another txp tag nesting php query

Roberto, you are a legend

however… I tried removing the main suspect and your new page template, but no luck!
hhmmf

this is proving a real tough case to crack… is it gonna be like watching whole series of Lost and expecting answers where there are only questions?
If so, maybe we should turn the telly off and go do something less boring instead. :o)

Offline

#19 2006-05-18 10:27:50

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: another txp tag nesting php query

pieman wrote:

…expecting answers…

“42”. Now that was a really simple one.

Back to square one. I’ve left a few //diagnostic code segments in the new template. Do they produce any visible output bracketed with pre tags? The should definitely output the current value of $pie_title twice.

Square two: A very basic question I should have asked a long long time ago: Which version and revision of Textpattern do you use?

Square three (“Stirring in the dirt” mode): Modify your page template and remove the sequence below, instead add it directly into your article_about form (the exact position might not matter) :

<txp:php>
global $pie_title;
$pie_title = title( array() );
// diagnostic code
dmp ( $pie_title );
// end of diagnostic code
</txp:php>

Sorry for chasing you around that much but I assume “42” won’t help that much as a solution.

R.

Offline

#20 2006-05-18 10:44:56

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: another txp tag nesting php query

  • square 1
    the <code>pre</code> tags are empty!!
  • square 2
    Textpattern version: 4.0.2 (r1076)
  • square 3 (drumroll please)
    you cracked it!!!
    the <code>pre</code> tags both contain the correct title value and the list is filtered by author :o)
    that’s genius

So the php needed to be in the article form after all?
My final question for you now… how do I lose the <code>pre</code> tags from the code?

Offline

#21 2006-05-18 10:58:38

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: another txp tag nesting php query

pieman wrote:

So the php needed to be in the article form after all?

Apparently, though it depends on the sequence of txp:article tags in a way I am not willing to debug any further ;-). Otherwise it wouldn’t have worked on my test site. I must admit that my test site runs a rather recent revision from the repository which is not advisable in case you’ll have to do long distance debugging for someone else running a more settled revision.

My final question for you now… how do I lose the <code>pre</code> tags from the code?

Just remove these lines from both the form and the template. It’s the call to dmp() that emitts the pre tags:

// diagnostic code
dmp ( $pie_title );
// end of diagnostic code

Be careful with the template to keep the global $pie_title; line. A proper template is here, highlights applied.

Skøl!

Offline

#22 2006-05-18 11:15:42

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: another txp tag nesting php query

Skøl! indeed
I am in your debt forever(ish).

Offline

Board footer

Powered by FluxBB