Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-05-02 21:58:19
- Moat
- Member
- Registered: 2006-03-11
- Posts: 21
If_category & article doesn't work
Hi, I have small problem.. I have <txp:if_category>
tag on my default page. If I put <txp:article />
or <txp:article_custom />
tag before that (in code), <txp:if_category>
doesn’t work any more and gives still category part of the tag, even on the homepage. How can I deal with this ?
Last edited by Moat (2006-05-02 21:58:57)
Offline
#2 2006-05-03 03:32:23
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: If_category & article doesn't work
<txp:if_category>
<!-- we're looking at a category list -->
<txp:article form="your_category_list_form" />
<txp:else />
<!-- we're not looking at a category list, so display the default -->
<txp:article form="your_regular_frontpage_form" />
</txp:if_category>
:)
Offline
#3 2006-05-03 14:05:40
- Moat
- Member
- Registered: 2006-03-11
- Posts: 21
Re: If_category & article doesn't work
Thanks for answering. But this is not my problem, I probably described it badly. I have a menu, where is a hover part – and there I am using a <txp:article_custom />
tag to make a list of links.. And in content, I have that code with <txp:if_category>
. And that is working only if I take out <txp:article_custom />
from the menu.
Offline
#4 2006-05-03 16:42:42
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: If_category & article doesn't work
Use of article_custom shouldn’t affect anything at all. :/
Can you share the url so we can see? Are you sure that you’ve closed all tags correctly, etc?
Offline
#5 2006-05-03 19:44:25
- Moat
- Member
- Registered: 2006-03-11
- Posts: 21
Re: If_category & article doesn't work
I could give you code, if I knew, how to insert a long part of code… :)
I’m quite sure it’s because of <txp:article_custom/>
. As I said, If I take it out, it’s ok, when I put it back, it’s… not ok. :)
Last edited by Moat (2006-05-03 19:46:37)
Offline
Re: If_category & article doesn't work
Moat wrote:
I could give you code, if I knew, how to insert a long part of code… :)
For long code, I recommend you this solution: How to paste arbitrary code
Offline
#7 2006-05-03 20:03:08
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: If_category & article doesn't work
Offline
#8 2006-05-03 22:07:02
- Moat
- Member
- Registered: 2006-03-11
- Posts: 21
Re: If_category & article doesn't work
Thanks… :) Code:
<code>
<div id=“content”>
<div id=“sidebar”>
<div id=“sidebar-content”>
<ul id=“hlavniMenu”>
<li><a href=”“ title=”…”>…</a></li>
<li><a href=“expedice/” title=“EXPEDICE”>EXPEDICE</a>
<ul id=“submenu”>
<txp:category_list type=“article” break=“li” />
</ul>
</li>
<li><a href=“foto/” title=“FOTO”>FOTO</a>
<ul id=“submenu”>
<txp:article_custom section=“foto” break=“li” />
</ul>
</li>
<li><a href=“o-nas/” title=”…”>…</a></li>
<li><a href=“kontakt/” title=“KONTAKT”>KONTAKT</a></li>
</ul>
<txp:search_input section=“clanky” form=“search”/>
</div></div>
<div id=“main”><div id=“main-content”>
<txp:if_category>
<txp:article listform=“articles” limit=“6” />
<br /><br />
<txp:newer>…</txp:newer><txp:older>…</txp:older>
<txp:else />
XXXXXXXXXXXXtextXXXXXXXXXXXXX
</txp:if_category>
</div></div>
<hr class=“cleaner” />
</div>
</code>
…this displays only <txp:if_category>
part – everywhere including homepage. If I took out that <txp:article_custom />
in “FOTO” in menu, it would be displayed correctly.
Last edited by Moat (2006-05-03 22:14:54)
Offline
#9 2006-05-04 05:40:42
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: If_category & article doesn't work
I don’t know if this is the cause (I don’t see why it should), but article_custom does not accept a “break” parameter. If removing it doesn’t fix it, go to your admin prefs and change your production setting to testing or debug, then reload the page. That should display any error that is causing the page to fail.
Offline
#10 2006-05-04 13:14:41
- Moat
- Member
- Registered: 2006-03-11
- Posts: 21
Re: If_category & article doesn't work
Thanks. Removing “break” in article_custom makes no change. But also in testing or debug mode there is nothing displayed. :(
Offline
Re: If_category & article doesn't work
In debug mode you will need to look at your page source of the page that is not functioning correctly. It should display (at the very end) a tag trace of everything used to generate your page. (or not generate it in this case)
Offline
#12 2006-05-04 15:06:37
- Moat
- Member
- Registered: 2006-03-11
- Posts: 21
Re: If_category & article doesn't work
Thanks.. I found out that page bahaves like a category if there is used prad_image_index plugin (I don’t know why). That is my problem. That article_custom
tag has a listform: <li><txp:permlink><txp:title /></txp:permlink></li>
. Anyway in that tag trace is this:
<code>
<txp:article_custom section=“foto” listform=“fotomenu” />
[SQL (0,000673): select *, unix_timestamp(Posted) as uPosted from `textpattern` where 1 and Status=‘4’ and Posted < now() and Section = ‘foto’ order by Posted desc limit 0, 10]
[SQL (0,000217): select Form from `txp_form` where `name` = ‘fotomenu’ limit 1]
[Form: fotomenu]
[Článek 23]
<txp:prad_image_index textcaption=“1” textalt=“0” c=“foto” />
[SQL (0,000822): select * from `txp_image` where category=‘foto’ and thumbnail=1 order by name]
</code><code>
<txp:permlink>
<txp:title/>
</txp:permlink>
</code>
huh?
Last edited by Moat (2006-05-04 15:09:27)
Offline