Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-04-23 17:06:16
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
DIY breadcrumbs
(I searched/googled but found nothing this like so i decided to post this little study.. )
need to know:- based on messy urls (for some nihilist reason i use them)
- links to current section/category
- outputs an amp still when no cat1 is set (IMHO cat1 should be used before cat2)
- might brake with several (custom) articles on the same page – didn’t test
- not the best crumb-o-matic but was fun way to learn how the article flow goes.
- a newbie’s tampering
<code>
“”“”“”“ template code “”“”“”“”“”
<txp:if_section name=”“><br />
<txp:else />
<a href=”<txp:site_url />”>home</a> /
<txp:section link=“1”/>
<txp:if_individual_article>
<txp:article form=“breadcrumb” listform=“breadcrumb” />
<txp:else />
/ <txp:category />
</txp:if_individual_article>
</txp:if_section>
“”“”“”“ this is form “breadcrumb” “”“”“”“”“”
/
<a href=”<txp:site_url />index.php?s=<txp:section />&c=<txp:category1 link=“0” />”><txp:category1 link=“0” /></a>
<txp:if_article_category number=“2” name=”“>
& <a href=”<txp:site_url />index.php?s=<txp:section />&c=<txp:category2 link=“0” />”><txp:category2 link=“0” /></a>
</txp:if_article_category>
“”“”“”“ end “”“”“”“”“”
</code>
(i hate posting code :P )
Want to have article title in the breadcrumbs? Just add <txp:title />
to end of the form. It shouldn’t be trivial to make the urls clean I think.. btw, if you strip the links the code becomes a lot clearer.
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
#2 2006-04-27 16:55:02
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
Re: DIY breadcrumbs
Actually it breaks previewing comments.. :P
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
#3 2006-05-22 19:43:13
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: DIY breadcrumbs
No it doesn’t if you use txp:comments_preview :)
Offline
#4 2006-06-04 06:05:42
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: DIY breadcrumbs
Question: what’s wrong with the txp:breadcrumb tag?
Alex
Offline
Re: DIY breadcrumbs
From a “bugs” point of view (?), there is one bug that was in 4.0.2 and it’s still in 4.0.3.
Offline
Re: DIY breadcrumbs
zem wrote:
Question: what’s wrong with the txp:breadcrumb tag?
From what I can see it doesn’t display category, or does it?
Offline
#7 2007-03-11 09:34:07
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: DIY breadcrumbs
…it doesn’t display category, or does it?
Yes, it does.
The bug Julián mentioned was later fixed in November, which means it’ll be in the next maintenance release. But, you can still use it in the meantime without problems:
<txp:if_section name="default">
<p><a class="noline" href="<txp:site_url />"><txp:sitename /></a></p>
<txp:else />
<txp:breadcrumb />
</txp:if_section>
Offline
#8 2007-05-07 20:15:28
- febrero
- New Member
- Registered: 2007-05-07
- Posts: 4
Re: DIY breadcrumbs
Hi all.
Somebody knows how to display the name of the current article?
i.e: Home(link) :: Section(link) :: Current article(span, no link)
Offline
Offline
#10 2007-05-07 22:35:48
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: DIY breadcrumbs
I don’t think <txp:title />
will work on a page ;)
In my breadcrumbs I use this
<txp:if_individual_article>
<txp:article form="article_title" />
</txp:if_individual_article>
Where form ‘article_title’ contains
<txp:title />
Offline
#11 2007-05-07 23:18:08
- febrero
- New Member
- Registered: 2007-05-07
- Posts: 4
Re: DIY breadcrumbs
Thanks Jakob.
Really simple!
Offline
Pages: 1