Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: glz_crumbs, simple breadcrumbs plugin
Yes maerso, you didn’t put glz_vars @ the top of that page where you are calling glz_crumbs.
I know that by spreading vars across multiple plug-ins I made matters more complicated, but imagine glz_vars more of a lib for all glz_ plugins.
With a suggestion for TXPs dev team that is “in the works”, glz_vars might become redundant & obsolete with glz_crumbs 0.4 ; ).
Offline
Re: glz_crumbs, simple breadcrumbs plugin
Cool that works great.
Offline
Offline
Re: glz_crumbs, simple breadcrumbs plugin
I see that the plug-in defaults to messy URLs – which is fine for my purposes, but would adding clean URL support create problems?
Offline
Offline
Re: glz_crumbs, simple breadcrumbs plugin
I think if you use the sitename/category/categoryname then it works.
It displays a list of the articles in that category using the default template
I would show you on the site I’m working on, but it has to stay on site at the moment.
Offline
Re: glz_crumbs, simple breadcrumbs plugin
Yes mearso, you are right. However, I couldn’t get it to work with sitename/sectionname/category/categoryname or sitename/section/sectionname/category/categoryname. Besides, there will always be <strong>?pg=</strong> so true clean URLs are still not possible.
Last edited by gerhard (2005-11-04 16:39:05)
Offline
Re: glz_crumbs, simple breadcrumbs plugin
Nice plug-in.
What I like from glz_crumbs over the built-in txp:breadcrumb is that glz_crumbs dont escape HTML elements if there are HTML in the section/category title.
I mean, if you have a section title that is <code>About <strong>me</strong></code>, this plug-in will output the breadcrumb without escaping the “strong” tags. So, you will get a breadcrumb like this one, when in a section frontpage
<a href=”“>Site Name</a> > About <strong>me</strong>
But problems starts when you are at an individual article page, because of title attribute in A tags.
This plug-in will output something like this
In the source:
<code><a href=”“>Site name</a> > <a href=”“ title=“About <strong>me</strong>”>About <strong>me</strong></a> > Article title</code>
So, <code>title=“About <strong>me</strong>”</code> will break the breadcrumb.
Maybe it’s difficult to strip-out HTML elements from section/category title before including it in <code>title</code> attribute in <code><a></code> element.
Or maybe not, by simple merging some functions used in sab_striphtml plug-in . But wait: if you (gerhard) think about strip out HTML from section/category title, do it only for the <code>title</code> attribute in <code><a></code> and not for the all breadcrumb. (did i explain myself?).
But a simple option to turn-off title attribute for links in the breadcrumb will also be a valid (and maybe an easy) solution.
Thanks!
Last edited by maniqui (2005-11-04 15:25:55)
Offline
Re: glz_crumbs, simple breadcrumbs plugin
Meanwhile, for avoid “bad” values for title attribute in links, I have manually remove titles from the plug-in code.
And a tip for using glz_vars: when you put it at the very top of your page template, put it in the same line as your XML declaration, (if you are using one).
I mean, do this:
<code><txp:glz_vars /><txp:output_form form=“head” /></code>
and not this:
<code><txp:glz_vars />
<txp:output_form form=“head” /></code>
This second one will return the following warning:
“line 2 column 1 – Warning: removing whitespace preceding XML Declaration”
Edit: I see that isnt a requisite to put the glz_vars tag at the very very top of the page. You can use it between your DTD and your < head> tag.
BTW, I have to ask something about this: <blockquote>I know that by spreading vars across multiple plug-ins I made matters more complicated, but imagine glz_vars more of a lib for all glz_ plugins.</blockquote>
What exactly means that? Could it be “dangerous” (for other plug-ins) to spread vars with glz_vars?
Last edited by maniqui (2005-11-04 16:06:14)
Offline
Re: glz_crumbs, simple breadcrumbs plugin
Can you make an option to show category 2 or not? Something like showcat2=“0” as well as showing the article title also like showarticle=“0”. I would like to be able to turn these off.
Refresh Dallas and other Refreshing Cities.
Offline
Re: glz_crumbs, simple breadcrumbs plugin
Long time no posts. Sorry guys, have been terribly busy. :sigh:
maniqui
I will have to find some time and go through your ideas. You have some interesting proposals.
Could it be “dangerous” (for other plug-ins) to spread vars with glz_vars?
No, not at all. Just that glz_vars
is a set of global variables I find handy to use (e.g. $siteurl
instead of $GLOBALS['siteurl']
etc.). If you want to use the variables defined in glz_vars
for your plugins or even for the website (e.g. global $siteurl; print $siteurl;
), you are more than welcome.
Once again, sorry for taking ages to reply.
tinyfly
glz_crumbs v 0.3.1 :wink:
Offline
Re: glz_crumbs, simple breadcrumbs plugin
Excellent, Thanks
Refresh Dallas and other Refreshing Cities.
Offline