Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: another txp tag nesting php query
When I put it into test-mode the only difference was a pair of empty <code>pre</code> tags above the list. Is this just a side-effect of the <code><txp:php></code> code, or sign of something more significant?
The results of the diagnostic <code>dmp()</code> call were that the list still showed all authors… should there be anything extra hidden in the source from using that approach? I couldn’t see anything unusual.
I’ve never really use ‘Debug’ mode so I’m not sure what’s happening there (& there doesn’t seem to be a FAQ for debugging)… theres a lot of stuff at the bottom of the source but the page renders the same and the list still shows all authors. Would it be useful to see the debuggin source output? – theres a lot of it!
Hard-coding does work as expected… might have to resort to hard-coding all the usernames within <code>if_author</code> conditionals. Ouch!
But if it definately works on your install I might build a clean install somewhere and try it again… could it be a clash with a plugin or something?
Last edited by pieman (2006-05-17 07:36:30)
Offline
Re: another txp tag nesting php query
pieman wrote:
When I put it into test-mode the only difference was a pair of empty <code>pre</code> tags above the list. Is this just a side-effect of the <code><txp:php></code> code, or sign of something more significant?
This is the output of the dmp
function which should embrace the value of “title” the subsequent php snippet relies on, and that is the reason why this whole mess exists. Obviously, $thisarticle['title']
does not containg a value. This is contradictory to the fact that there is a call to txp:article preceeding the php snippet as you said. Please double check.
theres a lot of stuff at the bottom of the source but the page renders the same and the list still shows all authors. Would it be useful to see the debuggin source output? – theres a lot of it!
In debugging mode, Textpattern appends a “tag trace” as a HTML comment at the end of the page listing every tag Textpattern encounters in the sequence in which they occur. It not very simple to dig through but it might give you another clue of whether there is really a call for txp:article
…
Would you mind sharing this tag trace (everything from the HTML comments at the page’s end)? Post here to avoid Textiling the whole mess… You made me curious, as this works as expected on my dev site ;-)
Offline
Re: another txp tag nesting php query
glad I made you so curious ;)
I posted my full page template so you can see the other <code>txp:article</code> calls above.
And my tag trace
Offline
Re: another txp tag nesting php query
That’ll take a while to dig through. Hold on…
Offline
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
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
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
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
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
Re: another txp tag nesting php query
Skøl! indeed
I am in your debt forever(ish).
Offline