Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2006-01-28 13:37:39

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: One Page (template) to rule them all

> Destry wrote:

<div id="sidebar">
<txp:if_section name="">
<txp:output_form form="mSearch" />
<txp:output_form form="mListHeader" />
<txp:article listform="alstDefault" limit="5" />
<txp:else />
<txp:output_form form="mListHeader" />
<txp:article listform="alstDefault" limit="5" />
</txp:if_section>
</div>

I think what you were suggesting with your second block of code in reply #21 above was to somehow represent <code>mListHeader</code> only once (since it’s the same on both sides of the conditional), right?

maniquí thinks: “hey, the <code><txp:article listform=“alstDefault” limit=“5” /></code> is on both sides of the conditional too so why aren’t you taking that into account?”

;)

Destry wrotes:

Because the respective article output will be tied to their representative Sections so even though it looks like the same output from the code, it really won’t be.

Really? Txp:article is context-(section)-sensitive. And thinking loud: how is it possible that the output is different if it is inside or outside a conditional (if in both sides of the conditional)?
I cant see that in my mind.

I insist with this new snippet:

<div id="sidebar">
<txp:if_section name="">
<txp:output_form form="mSearch" />
</txp:if_section>
<txp:output_form form="mListHeader" />
<txp:article listform="alstDefault" limit="5" />
</div>

That means: “if we are in section default (home page), output the “mSearch” form, and also the “mListHeader” form followed by a article list using “alstDefault” as listform. So, when not in section default, that snippet will simple output the “mListHeader” form followed by a 5 article list using “alstDefault” as listform.

As you said, for me, “it looks like the same output from the code” or am i totally wrong?

I haven’t yet tested the comments behaviors as talked about earlier, but I will when I get time and report back.

That, an also the problem of when you are in an individual-article context, because each “txp:article” tag will output data from the current viewed article.
Maybe, you can try:

  • the idea of an empty form for the “form” attribute (see above) (and if you try it, please, tell us if it works).
  • wrap the snippet with <txp:if_article_list>###</txp:if_article_list> , like:
<div id="sidebar">
<txp:if_article_list>
<txp:if_section name="">
<txp:output_form form="mSearch" />
</txp:if_section>
<txp:output_form form="mListHeader" />
<txp:article listform="alstDefault" limit="5" />
</txp:if_article_list>
</div>

So, in an individual-article context, it wont output anything.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#26 2006-01-28 17:17:40

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: One Page (template) to rule them all

LOL…Maniqui schooled me again. See ladies and gentlemen, this is why maniqui is Moderator of the Tag Examples forum.

Actually I think I’ve let this thread get way out of hand. Although each code block that’s been presented up to this point has been getting progressively more refined, and could have useful applications in other ways, nothing to this point works exactly as I was originally setting out to achieve (and I don’t think the empty Form suggestion is what I’m after). Basically, category lists in the sidebar are not behaving as I want, and I think it’s beyond my patience at the moment to try and explain again in another way (I’ve made a couple revisions in my original post, but that’s as far as I’m going).

I am of the mind, for now, that what I was setting out to do is probably not practical, nor is it even looking like it’s possible under the limited conditions I set out to impose. It’s probably easier to just throw in a couple extra Page templates as needed and/or consider a plugin (if one fits the bill) and call it good. As always, if I discover something of relevance, I’ll report it; but this is going on the back burner.

Offline

Board footer

Powered by FluxBB