Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
articles posting multiple times
Be easy on me, I’m very new at this…
My hubby and I have a domain that we share, and I’m trying my hand at customizing my page/blog. I didn’t like the article names listed below the Ruth’s Blog section, so I downloaded and installed the cbs_category_list plugin so it would list my articles by category. Problem is, the list of categories is showing up multiple times based on the number of articles there are. There are two articles, both under Interests, so it’s showing up twice. I tested it with a third article, and it showed up three times.
I wasn’t involved in the initial building of this site, but as far as I can tell, the “default” page wasn’t changed much from what was provided by textpattern.
This is the code for the sidebar I am having trouble with. visit henager.net/ruthsblog to see what I’m talking about. (There are also those pesky scroll bars that I don’t know how to get rid of) I’ve not changed anything in this code besides putting in the plugin, which replaced a <txp:title /> tag.
<!-- left -->
<div id="sidebar-1">
<txp:section_list default_title='<txp:text item="home" />' include_default="1" wraptag="ul" break="li">
<txp:if_section name='<txp:section />'>»</txp:if_section>
<txp:section link="1" title="1" />
<txp:if_section name='<txp:section />'>
<txp:article_custom section='<txp:section />' wraptag="ul" break="li">
<txp:if_article_id>›</txp:if_article_id>
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
</txp:if_section>
</txp:section_list>
<txp:search_input wraptag="p" />
<p><txp:feed_link label="RSS" /> / <txp:feed_link flavor="atom" label="Atom" /></p>
</div>
(added bc.
for better code display. -Els)
Last edited by els (2009-10-15 23:18:57)
“Degradation – Sometimes mispronounced “degration”, as in, “there’s a degration of the English language going on and nobody notices”.” – David Miller (http://innersting.blogspot.com/)
Offline
Re: articles posting multiple times
You can do this with standard txp tags but it’s missing the article count.
<div id="sidebar-1">
<txp:section_list default_title='<txp:text item="home" />' include_default="1" wraptag="ul" break="li">
<txp:if_section name='<txp:section />'>»</txp:if_section>
<txp:section link="1" title="1" />
<txp:if_section name='<txp:section />'>
<!-- Changed -->
<txp:category_list section='<txp:section />' wraptag="ul" break="li">
<txp:if_category name='<txp:category />'>›</txp:if_category>
<txp:category title="1" link="1" />
</txp:category_list>
<!-- END Changed -->
</txp:if_section>
</txp:section_list>
<txp:search_input wraptag="p" />
<p><txp:feed_link label="RSS" /> / <txp:feed_link flavor="atom" label="Atom" /></p>
If you only want to display categories with articles you can use code from this txptip (not tested)
<div id="sidebar-1">
<txp:section_list default_title='<txp:text item="home" />' include_default="1" wraptag="ul" break="li">
<txp:if_section name='<txp:section />'>»</txp:if_section>
<txp:section link="1" title="1" />
<txp:if_section name='<txp:section />'>
<!-- Changed -->
<txp:category_list section='<txp:section />' wraptag="ul" break="li">
<txp:variable name="hasarticle" value='<txp:article_custom category=''<txp:category />'' limit="1" />' />
<txp:if_variable name="hasarticle" value="">
<txp:else />
<txp:if_category name='<txp:category />'>›</txp:if_category>
<txp:category title="1" link="1" />
</txp:if_variable name>
</txp:category_list>
<!-- END Changed -->
</txp:if_section>
</txp:section_list>
<txp:search_input wraptag="p" />
<p><txp:feed_link label="RSS" /> / <txp:feed_link flavor="atom" label="Atom" /></p>
Last edited by MattD (2009-10-15 23:19:37)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: articles posting multiple times
You’re getting a category list for each article in the section, because you have cbs_category_list
inside the article_custom
tag. Whatever is inside the article_custom
tag gets shown for each article in the specified section. Try one of Matt’s suggestions (note how he got rid of the article_custom
tag). If you prefer the way cbs_category_list
works, you could substitute that for category_list
in Matt’s examples, although it might not work as a container tag (it’s an older plugin).
Code is topiary
Offline
Re: articles posting multiple times
Awesome! I used Matt’s first example and just substituted the cbs_category_list tag for the category_list tag, as jsoo suggested, and it worked! I knew it must have something to do with the article_custom tag, but I had no clue how to fix my problem because I thought that tag had to be there, heh. Live and learn!
Thanks guys! I appreciate it!
“Degradation – Sometimes mispronounced “degration”, as in, “there’s a degration of the English language going on and nobody notices”.” – David Miller (http://innersting.blogspot.com/)
Offline
Pages: 1