Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-18 15:14:52

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Problem with staying in section (the section/?c=category method)

When using the method described in the title to force the specific category articles to be listed within the blog section page, I simply have no “luck”. It won’t work, and it lists all articles always.

Here is the example on my new redesigned site: http://dnevnikeklektika.com (example URL: http://dnevnikeklektika.com/blog/?c=usability )

Here is an example of my other site, where the method works perfectly: http://herbiv.org/

Can anyone help me with this?

Offline

#2 2006-07-18 15:42:44

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Problem with staying in section (the section/?c=category method)

I don’t understand. Are you using redirects of a kind? Your links say http://dnevnikeklektika.com/category/novosti/ but they go to http://dnevnikeklektika.com/blog/?c=novosti. Except for ‘usability’ that one really goes to /category/usability. But none of them seem to work.

What is the code (article tags and conditionals) you are using on the page?

Offline

#3 2006-07-18 15:59:08

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: Problem with staying in section (the section/?c=category method)

Yes, I am redirectin all of my old links that were in the form of /category/nameofcategory to /blog/?c=nameofcategory. I don’t think that can have something to do with this not working.

Here is the txp code i am using for category links: <a href="<txp:site_url /><txp:section />/?c=<txp:category1 />"><txp:category1 title="1" /></a>

Offline

#4 2006-07-18 16:00:16

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: Problem with staying in section (the section/?c=category method)

Here is my default article form:
<code> <txp:if_section name=”,blog”><h2><txp:permlink><txp:title /></txp:permlink> <span class=“postInfo”><img src=”<txp:site_url />img/icon-page_02.png” width=“9” height=“11” alt=”“ /> <txp:posted /> pod: <img src=”<txp:site_url />img/icon-tag-green-small.png” width=“8” height=“8” alt=”“ /> <a href=”<txp:site_url /><txp:section />/?c=<txp:category1 title=“1” />”><txp:category1 title=“1” /></a><txp:chh_if_data>, <a href=”<txp:site_url /><txp:section />/?c=<txp:category2 title=“1” />”><txp:category2 title=“1” /></a></txp:chh_if_data>, <txp:if_comments><a href=”#komentari” class=“commentsInvite”> <img src=”<txp:site_url />img/icon-comment_02.png” width=“12” height=“12” alt=”“ /> <txp:comments_count /> komentara</a> <txp:else /><a href=”#txpCommentInputForm”><img src=”<txp:site_url />img/icon-comment_02.png” width=“12” height=“12” alt=”“ /> Dodaj prvi komentar</a></txp:if_comments></span></h2><txp:else /><h2 class=“staticTitle”><txp:title /></h2></txp:if_section>
<txp:body /> <txp:if_section name=”,blog”><ul class=“prevNext”> <li><txp:chh_if_data><txp:link_to_prev><txp:prev_title /></txp:link_to_prev><txp:else /><p class=“lastEntry”>Nema daljih unosa, probaj sa <a href=”<txp:site_url />arhiva/”>arhivom</a>.</p></li></txp:chh_if_data> <li class=“next”><txp:chh_if_data><txp:link_to_next><txp:next_title /></txp:link_to_next><txp:else /><p class=“lastEntry”>Nema daljih unosa, probaj sa <a href=”<txp:site_url />arhiva/”>arhivom</a>.</p></li></txp:chh_if_data> </ul></txp:if_section>
</code>

Last edited by Dragan (2006-07-18 16:02:22)

Offline

#5 2006-07-18 16:08:18

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Problem with staying in section (the section/?c=category method)

I’m not sure what you intend to do, but <txp:if_section> doesn’t belong in an article form.
If you mean to say “if we are on this section page (article list)…” then <txp:if_section> should go in the page template, and surround your article tag.
If you mean “if this article is in section…” then you need <txp:if_article_section> in your article form.

Offline

#6 2006-07-18 16:41:50

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: Problem with staying in section (the section/?c=category method)

I seriously cannot grasp this. I have gotten rid of the if_section conditionals from the article form, and now my blog page template looks like this:
<code>
<txp:output_form form=“head” />

<txp:output_form form=“headerMainIlustr” />

<div id=“mainContent”> <txp:if_section name=”,blog”> <txp:if_article_list> <ul id=“archiveList”> <txp:article_custom limit=“10” section=“blog” form=“archiveList” /> </ul> <ul class=“prevNext”> <li><txp:chh_if_data><txp:newer>&laquo; Noviji unosi</txp:newer><txp:else /><p class=“lastEntry”>Nema daljih unosa, probaj sa <a href=”<txp:site_url />arhiva/”>arhivom</a>.</p></li></txp:chh_if_data> <li class=“next”><txp:chh_if_data><txp:older>Stariji unosi &raquo;</txp:older><txp:else /><p class=“lastEntry”>Nema daljih unosa, probaj sa <a href=”<txp:site_url />arhiva/”>arhivom</a>.</p></li></txp:chh_if_data> </ul> <txp:else /> <txp:article form=“default” /> </txp:if_article_list> <txp:else /> <txp:article form=“defaultStatic” /> </txp:if_section> </div><!— #mainContent —> <div id=“innerSecContent”> <div id=“recentEntries”> <h3>Prethodni unosi</h3> <ol class=“recentsList”> <txp:article_custom section=“blog” limit=“10” form=“recentArticles” /> </ol> </div> <div id=“recentComments”> <h3>Skoriji komentari</h3> <ol id=“recentCommentsList” class=“recentsList”> <txp:recent_comments limit=“10” break=“li” /> </ol> </div> <h3>Šta je sad ovo?</h3> <p>Ovo je jedan od mnogih unosa iz <a href =”<txp:site_url />blog/” title=“Blog”>Draganovog dnevnika</a>. Ukoliko vas je kojim slučajem zainteresovao, procunjajte <a href=”<txp:site_url />arhiva/” title=“Pregledajte arhivu dnevnika”>arhivom</a>, možda nađete još nešto što će vam biti od koristi. Ko zna, ima nas svakakvih. ;)</p> <!— <form id=“searchForm” action=”<txp:site_url />” method=“get”> <h3>Pretraži sajt</h3> <p> <label for=“q”>Pretraga:</label> <input type=“text” id=“q” name=“q” value=”“ size=“30” /> </p> </form> —> <h3>Mmmm, delišs…</h3> <dl id=“miniPostList”> <txp:linklist form=“miniPostList” limit=“10” category=“delicious” sort=“date desc” /> </dl> </div> <!— #innerSecContent —>

<txp:output_form form=“footer” />
</code>

and my default article form (used to output the articles in the blog section):
<code> <h2><txp:permlink><txp:title /></txp:permlink> <span class=“postInfo”><img src=”<txp:site_url />img/icon-page_02.png” width=“9” height=“11” alt=”“ /> <txp:posted /> pod: <img src=”<txp:site_url />img/icon-tag-green-small.png” width=“8” height=“8” alt=”“ /> <a href=”<txp:site_url /><txp:section />/?c=<txp:category1 title=“1” />”><txp:category1 title=“1” /></a><txp:chh_if_data>, <a href=”<txp:site_url /><txp:section />/?c=<txp:category2 title=“1” />”><txp:category2 title=“1” /></a></txp:chh_if_data>, <txp:if_comments><a href=”#komentari” class=“commentsInvite”> <img src=”<txp:site_url />img/icon-comment_02.png” width=“12” height=“12” alt=”“ /> <txp:comments_count /> komentara</a> <txp:else /><a href=”#txpCommentInputForm”><img src=”<txp:site_url />img/icon-comment_02.png” width=“12” height=“12” alt=”“ /> Dodaj prvi komentar</a></txp:if_comments></span></h2>

<txp:body />

<ul class=“prevNext”> <li><txp:chh_if_data><txp:link_to_prev><txp:prev_title /></txp:link_to_prev><txp:else /><p class=“lastEntry”>Nema daljih unosa, probaj sa <a href=”<txp:site_url />arhiva/”>arhivom</a>.</p></li></txp:chh_if_data> <li class=“next”><txp:chh_if_data><txp:link_to_next><txp:next_title /></txp:link_to_next><txp:else /><p class=“lastEntry”>Nema daljih unosa, probaj sa <a href=”<txp:site_url />arhiva/”>arhivom</a>.</p></li></txp:chh_if_data> </ul> </code>

It still doesn’t work, am I doing something terribly wrong and don’t see it?

Last edited by Dragan (2006-07-18 16:50:30)

Offline

#7 2006-07-18 16:43:26

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: Problem with staying in section (the section/?c=category method)

Also, the pagination on article listings don’t work now (it is in the page template)

Offline

#8 2006-07-18 17:24:25

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: Problem with staying in section (the section/?c=category method)

One of the things I am also noticing is that chh_if_data doesn’t quite work in the span within the h2. I can tell this by the comma that is being output, and it shouldn’t.

Offline

#9 2006-07-18 17:32:44

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: Problem with staying in section (the section/?c=category method)

Solved!

The problem was in the article_custom in the if_article_list conditional. I have set it t otxp:article and now it works fine.

Thanx for all the help Els!

Offline

#10 2006-07-19 00:26:10

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Problem with staying in section (the section/?c=category method)

Glad you figured it out, most of it was your own effort though… ;)

Offline

Board footer

Powered by FluxBB