Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-01-03 22:07:20
- TWD
- Member
- Registered: 2009-09-10
- Posts: 14
Breadcrumbs, categories, subcategories, and subcategory list display.
Hi! I have a load of possibly interrelated questions… sorry if this gets confusing!
This is part of the default
page:
<txp:if_section name="default"><txp:else />
<p class="breadcrumb"><txp:breadcrumb wraptag="" title="1" /><txp:if_individual_article> » <txp:title /></p>
</txp:if_individual_article></txp:if_section>
This is part of the tutorials
page:
<p class="breadcrumb"><txp:breadcrumb wraptag="" title="1" />
<txp:if_individual_article> » <txp:title /></txp:if_individual_article></p>
On the site’s homepage, I show the most recent blog posts, all of which are published to the blogs
section. With each blog I list its category, and if you click on that, whether from the homepage (default section) or from the individual article page (blogs section), the breadcrumb disappears, when I would have thought it would say something along the lines of Site Name > Blog > Category.
I have a section called “tutorials”. I also have a category called “tutorials” with subcategories. When you go to the tutorials section, the most recent tutorial articles are displayed, along with a list of the subcategories in the sidebar. If you click on one of those, you are directed to /tutorials?c=subcategory
and the breadcrumb is displayed as such: Site Name > Tutorials (link goes to /tutorials
) > Tutorials (link goes to /category/tutorials
) > Subcategory (link goes to /category/subcategory
). (As another note, the articles are not posted to the tutorials category but only the subcategory.) Clicking on the subcategory link in the breadcrumb takes you a page with no breadcrumb and no articles, and the sidebar is that of the default page and not of the tutorials page.
Also, in debugging mode, an error pops up on /tutorials?c=subcategory
(although it displays fine in live mode):
Tag error: <txp:else /> -> Textpattern Warning: tag does not exist on line 1120
This doesn’t show up on any other pages, but the code in the tutorials page is virtually identical to that of the default page.
So my questions are:
What section do category listings fall under? Subcategory listings?
What’s the difference between /category/subcategory and /tutorials?c=subcategory?
Why does nothing come up under the subcategory listing when accessed from /category/subcategory?
What exactly are breadcrumbs programmed to display?
Thanks for the help! :)
Here’s the tag trace for /category/subcategory:
<!-- txp tag trace:
[SQL (0.012221813201904): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.0050220489501953): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.0037741661071777): show tables like "cha_txp_discuss_rel"]
[SQL (0.003093957901001): select name from txp_category where `name` like 'advanced-picture' limit 1]
[SQL (0.0024788379669189): select page, css from txp_section where name = 'default' limit 1]
[SQL (0.0027849674224854): select host from txp_log where ip='::1' limit 1]
[SQL (0.0013601779937744): insert into txp_log set `time`=now(),page='/category/advanced-picture/',ip='::1',host='::1',refer='',status='200',method='GET']
[SQL (0.0031321048736572): select user_html from txp_page where name='default']
[Page: default]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
<txp:if_category>
[<txp:if_category>: true]
<txp:category title="1" />
[SQL (0.00081300735473633): select title from txp_category where name='advanced-picture' and type='article']
</txp:if_category>
</txp:if_individual_article>
<txp:css n="reset" format="link" />
<txp:css n="default" format="link" />
<txp:if_section name="default">
[<txp:if_section name="default">: true]
</txp:if_section>
<txp:if_section name="free-resources">
[<txp:if_section name="free-resources">: false]
</txp:if_section>
<txp:if_section name="tutorials">
[<txp:if_section name="tutorials">: false]
</txp:if_section>
<txp:if_section name="blogs">
[<txp:if_section name="blogs">: false]
</txp:if_section>
<txp:if_section name="default">
[<txp:if_section name="default">: true]
</txp:if_section>
<txp:if_search>
[<txp:if_search>: false]
</txp:if_search>
<txp:article limit="3" />
[SQL (0.00063419342041016): select name from txp_section where on_frontpage != '1']
[SQL (0.013640880584717): select count(*) from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('advanced-picture') or Category2 IN ('advanced-picture')) and Section != 'articles' and Section != 'free-resources' and Section != 'tutorials']
[SQL (0.019814014434814): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('advanced-picture') or Category2 IN ('advanced-picture')) and Section != 'articles' and Section != 'free-resources' and Section != 'tutorials' order by Posted desc limit 0, 3]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
<txp:ob1_pagination maximumtabs="5" firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulid="pagination" liempty="empty" liselected="active" moretabsdisplay="1" moretabstext="after" />
</txp:if_individual_article>
<txp:article_custom section="tutorials" limit="1">
[SQL (0.0027291774749756): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('tutorials') order by Posted desc limit 0, 1]
[article 331]
<txp:excerpt />
<txp:permlink>
</txp:permlink>
<txp:permlink class="readmore">
</txp:permlink>
</txp:article_custom>
<txp:article_custom sort="LastMod desc" limit="3">
[SQL (0.018950223922729): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by LastMod desc limit 0, 3]
[article 34]
<txp:posted format="%m/%d" />
<txp:permlink>
<txp:title />
</txp:permlink>
[article 22]
<txp:posted format="%m/%d" />
<txp:permlink>
<txp:title />
</txp:permlink>
[article 319]
<txp:posted format="%m/%d" />
<txp:permlink>
<txp:title />
</txp:permlink>
</txp:article_custom>
[ ~~~ secondpass ~~~ ]
-->
And here it is for /tutorials?c=subcategory
<!-- txp tag trace:
[SQL (0.0097000598907471): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.002418041229248): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.0043909549713135): show tables like "cha_txp_discuss_rel"]
[SQL (0.00074315071105957): select name from txp_section where `name` like 'tutorials' limit 1]
[SQL (0.00058102607727051): select page, css from txp_section where name = 'tutorials' limit 1]
[SQL (0.00072598457336426): select host from txp_log where ip='::1' limit 1]
[SQL (0.0006251335144043): insert into txp_log set `time`=now(),page='/tutorials/?c=advanced-picture',ip='::1',host='::1',refer='',status='200',method='GET']
[SQL (0.00084304809570312): select user_html from txp_page where name='tutorials']
[Page: tutorials]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
<txp:if_category>
[<txp:if_category>: true]
<txp:category title="1" />
[SQL (0.00079989433288574): select title from txp_category where name='advanced-picture' and type='article']
</txp:if_category>
</txp:if_individual_article>
<txp:css n="reset" format="link" />
<txp:css n="default" format="link" />
<txp:if_section name="default">
[<txp:if_section name="default">: false]
</txp:if_section>
<txp:if_section name="free-resources">
[<txp:if_section name="free-resources">: false]
</txp:if_section>
<txp:if_section name="tutorials">
[<txp:if_section name="tutorials">: true]
</txp:if_section>
<txp:if_section name="blogs">
[<txp:if_section name="blogs">: false]
</txp:if_section>
<txp:breadcrumb wraptag="" title="1" />
[SQL (0.00094294548034668): select title from txp_section where name='tutorials']
[SQL (0.00062084197998047): select lft as l, rgt as r from txp_category where name='advanced-picture' and type = 'article']
[SQL (0.00067996978759766): select * from txp_category where lft <= 41 and rgt >= 42 and type = 'article' order by lft asc]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
<txp:if_search>
[<txp:if_search>: false]
</txp:if_search>
<txp:article limit="4" form="tutorials" />
[SQL (0.0060920715332031): select count(*) from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('advanced-picture') or Category2 IN ('advanced-picture')) and Section IN ('tutorials')]
[SQL (0.012959003448486): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('advanced-picture') or Category2 IN ('advanced-picture')) and Section IN ('tutorials') order by Posted desc limit 0, 4]
[article 148]
[SQL (0.00068402290344238): select Form from txp_form where name='tutorials']
[Form: tutorials]
<txp:permlink>
<txp:title />
</txp:permlink>
<txp:if_article_list>
[<txp:if_article_list>: true]
<txp:if_excerpt>
[<txp:if_excerpt>: false]
<txp:else />
Tag error: <txp:else /> -> Textpattern Warning: tag does not exist on line 1120
</txp:if_excerpt>
</txp:if_article_list>
<txp:posted />
<txp:category1 title="1" />
<txp:permlink />
<txp:comments_count />
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
[article 147]
[Form: tutorials]
<txp:permlink>
<txp:title />
</txp:permlink>
<txp:if_article_list>
[<txp:if_article_list>: true]
<txp:if_excerpt>
[<txp:if_excerpt>: false]
<txp:else />
Tag error: <txp:else /> -> Textpattern Warning: tag does not exist on line 1120
</txp:if_excerpt>
</txp:if_article_list>
<txp:posted />
<txp:category1 title="1" />
<txp:permlink />
<txp:comments_count />
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
[article 146]
[Form: tutorials]
<txp:permlink>
<txp:title />
</txp:permlink>
<txp:if_article_list>
[<txp:if_article_list>: true]
<txp:if_excerpt>
[<txp:if_excerpt>: false]
<txp:else />
Tag error: <txp:else /> -> Textpattern Warning: tag does not exist on line 1120
</txp:if_excerpt>
</txp:if_article_list>
<txp:posted />
<txp:category1 title="1" />
<txp:permlink />
<txp:comments_count />
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
[article 145]
[Form: tutorials]
<txp:permlink>
<txp:title />
</txp:permlink>
<txp:if_article_list>
[<txp:if_article_list>: true]
<txp:if_excerpt>
[<txp:if_excerpt>: false]
<txp:else />
Tag error: <txp:else /> -> Textpattern Warning: tag does not exist on line 1120
</txp:if_excerpt>
</txp:if_article_list>
<txp:posted />
<txp:category1 title="1" />
<txp:permlink />
<txp:comments_count />
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
<txp:if_individual_article>
[<txp:if_individual_article>: false]
<txp:ob1_pagination maximumtabs="5" firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulid="pagination" liempty="empty" liselected="active" moretabsdisplay="1" moretabstext="after" />
</txp:if_individual_article>
<txp:category_list break="" parent="tutorials" exclude="tutorials" sort="title">
[SQL (0.0011019706726074): select lft, rgt from txp_category where type = 'article' and name = 'tutorials']
[SQL (0.0007011890411377): select name, title from txp_category where (lft between 40 and 47) and type = 'article' and name != 'default' and name not in('tutorials') order by title]
<txp:if_category name='<txp:category />'>
[attribute 'name']
<txp:category />
[/attribute]
[<txp:if_category name='<txp:category />'>: true]
</txp:if_category>
<txp:category title="1" link="1" />
<txp:if_category name='<txp:category />'>
[attribute 'name']
<txp:category />
[/attribute]
[<txp:if_category name='<txp:category />'>: false]
</txp:if_category>
<txp:category title="1" link="1" />
<txp:if_category name='<txp:category />'>
[attribute 'name']
<txp:category />
[/attribute]
[<txp:if_category name='<txp:category />'>: false]
</txp:if_category>
<txp:category title="1" link="1" />
</txp:category_list>
[ ~~~ secondpass ~~~ ]
-->
Offline
Re: Breadcrumbs, categories, subcategories, and subcategory list display.
Dude, i’d love to help you but this is just way too much for anyone to read. Tip: break down you questions as much as possible into bit size questions. You help yourself to understand the problem and help readers to see quickly what it is you want. Your question us confusing and that’s probably why no-one has answered. Help us to help you.
I am attempting to do a similar thing to (what i believe) you are trying to do. If i get it sorted, i’ll post the code.
Last edited by Timid&friendly (2010-06-11 05:20:54)
I think, therefore I AM, … … er … I think :-?
Offline