Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-27 13:58:37

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

article category list which section is not set to "on front page"

is it possible to display articles in category list which section is not set to “on front page”?

my page template:

<txp:if_section name="linnulaul">
<txp:category_list type="article" break="li" wraptag="ul" />
</txp:if_section>

it displays articles associated with those categories in a list only then the section is set to “on front page”

and the page i’m talking about

Offline

#2 2009-10-27 18:00:36

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

Re: article category list which section is not set to "on front page"

You need this_section="1" in your category_list tag, and of course an article tag inside your if_section tags to display the articles.

Offline

#3 2009-10-28 10:04:37

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: article category list which section is not set to "on front page"

Els wrote:

You need this_section="1" in your category_list tag, and of course an article tag inside your if_section tags to display the articles.

thank’s. now we moved a little bit closer – it displays articles inside categories, but also in that section frontpage – i don’t want that. i would like to see only that category list in that section’s frontpage. my goal is to use that category list as section’s submenu.

the page

and my current code:

<txp:if_section name="linnulaul">
<txp:category_list this_section="1" type="article" break="li" wraptag="ul" />
<txp:article limit="99" />
</txp:if_section>

Offline

#4 2009-10-28 11:55:55

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: article category list which section is not set to "on front page"

basically i would like to get the same solution like in this topic , but the category list should appear above the content instead the sidebar

Offline

#5 2009-10-28 17:59:11

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

Re: article category list which section is not set to "on front page"

Like this?

<txp:if_section name="linnulaul">
     <txp:if_article_list>
          <txp:if_category>
               <txp:article limit="99" />
          <txp:else />
               <txp:category_list this_section="1" type="article" break="li" wraptag="ul" />
          </txp:if_category>
     <txp:else />
          <txp:article />
     </txp:if_article_list>
</txp:if_section>

Offline

#6 2009-10-29 12:09:48

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: article category list which section is not set to "on front page"

exactly! thank you.

one more request. how to show the number of articles after category name? like here

Offline

#7 2009-10-29 12:58:51

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: article category list which section is not set to "on front page"

Gallex wrote:

one more request. how to show the number of articles after category name? like here

Hi Gallex, mdn_count will do that for you.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2009-10-29 13:57:17

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: article category list which section is not set to "on front page"

colak wrote:

Hi Gallex, mdn_count will do that for you.

where in my code above exactly i should put this <txp:mdn_count [section="sectionname"] [category="categoryname"] /> :)

Last edited by Gallex (2009-10-29 13:58:11)

Offline

#9 2009-10-29 15:00:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: article category list which section is not set to "on front page"

Gallex wrote:

where in my code above exactly i should put this <txp:mdn_count [section="sectionname"] [category="categoryname"] /> :)

That is a problem as the link you have posted is probably hand coded list of categories. I use the plugin myself and my menu is hand coded.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2009-10-29 15:13:41

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

Re: article category list which section is not set to "on front page"

Gallex wrote:

where in my code above exactly i should put this <txp:mdn_count [section="sectionname"] [category="categoryname"] /> :)

You may want to use txp:category_list as a container tag and try the following (not tested):

<txp:if_section name="linnulaul">
     <txp:if_article_list>
          <txp:if_category>
               <txp:article limit="99" />
          <txp:else />
               <txp:category_list type="article" break="li" wraptag="ul">
               <a href="<txp:section />/?c=<txp:category />"><txp:category title="1" /> (<txp:mdn_count section='<txp:section />' category='<txp:category />' />)</a>
               </txp:category_list>
          </txp:if_category>
     <txp:else />
          <txp:article />
     </txp:if_article_list>
</txp:if_section>

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2009-10-30 12:39:41

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: article category list which section is not set to "on front page"

maniqui wrote:

You may want to use txp:category_list as a container tag and try the following (not tested):

it’s difficult to understand your solution for me ;) , but yes, it’s working

Last edited by Gallex (2009-10-30 12:40:53)

Offline

#12 2009-10-30 12:54:32

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: article category list which section is not set to "on front page"

colak wrote:

That is a problem as the link you have posted is probably hand coded list of categories.

…no…i don’t know it would. it displays all categories i have added into “article categories”

I use the plugin myself and my menu is hand coded.

could you provide your code?

just wonder…there is should be a simplier solution than maniqui’s…

Offline

Board footer

Powered by FluxBB