Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#211 2007-02-21 17:07:59

adnanoner
Member
Registered: 2007-01-01
Posts: 20

Re: [Archived] stw_category_tree

Hey guys, I’m having a problem.
My page turns blank/404 even when I use the basic stw_category_tree plugin. I think it has got something to do with the “sgb_url_handler:“http://forum.textpattern.com/viewtopic.php?id=6810&p=30 , because when I used it my whole website turned blank. I now deinstalled and deleted it, but my stw_category_tree still seems not to work.

Anybody got an idea on how to fix it? Or is there a plugin that does the same as the stw_category_tree plugin?

Thanks in advance!

Offline

#212 2007-02-21 17:17:36

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [Archived] stw_category_tree

I can’t answer your question about why stw_category_tree isn’t working but I know sgb_url_handler is no longer supported and there is a fantastic replacement out there called gbp_permanent_links if you want to try it out.

Offline

#213 2007-02-21 17:30:42

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [Archived] stw_category_tree

The two are probably not related.

Although sgb_url_handler is not supported, it still works well for me, and will keep using it till greame’s excellent plugin to support image categories.

You can turn off “sgb_url_handler’s” dependence on “sgb_error_handler” and also tell it not to do any error redirects by editing some lines at the top of the plugin.

// Include sgb_error_documents
//include_plugin(‘sgb_error_documents’); <—Comment out this line, like this

$config[‘send_errors’] = 0; // bool <— change the one to zero

// Send 301 redirects? $config[‘send_301’] = 0; // bool <— change the one to zero

// Send 404 not founds? $config[‘send_404’] = 0; // bool <— change the one to zero

Offline

#214 2007-03-17 10:17:21

avetma
Member
Registered: 2006-03-11
Posts: 28

Re: [Archived] stw_category_tree

I am using txp:stw_category_tree tag, and I have problem with URL’s. They doesn’t contain section but only category. Is there any way to put section in url too? (s=something&c…)

Thank you

Offline

#215 2007-03-17 10:35:50

Joey
Member
From: Netherlands
Registered: 2005-01-19
Posts: 257

Re: [Archived] stw_category_tree

Use the section attribute, see the first post for details.


Regards,

Joey

Offline

#216 2007-03-17 11:49:18

avetma
Member
Registered: 2006-03-11
Posts: 28

Re: [Archived] stw_category_tree

Thank you, that’s it ;)

Offline

#217 2007-04-02 19:48:15

fuls
Member
Registered: 2005-11-16
Posts: 117
Website

Re: [Archived] stw_category_tree

Is it possible to use some kind of category list sorting with this plugin?

Offline

#218 2007-04-02 21:10:23

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [Archived] stw_category_tree

fuls wrote:

Is it possible to use some kind of category list sorting with this plugin?

Not as such, although you can use the category “name” for ordering and the “title” for display. So you could do the following…

  1. category title=“people” and name=“01-people”
  2. category title=“animals” and name=“02-animals”

to list people before animals in a list.

Offline

#219 2007-05-07 02:28:31

jonhenshaw
New Member
From: Nashville, TN
Registered: 2007-05-07
Posts: 3
Website

Re: [Archived] stw_category_tree

I’ve read through this thread and haven’t been able to find an answer to my problem. stw_category_tree works great, except I really want to remove “category” from the URL.

For example, I have a top-level category called “computers” and a sub-category called “apple”. These are the URLs it creates:

  • http://domain.com/category/computers
  • http://domain.com/category/apple

Is there anyway to get rid of the “category” in the URL so it show like this:

  • http://domain.com/computers
  • http://domain.com/apple (or http://domain.com/computers/apple)

This is my current code:

<txp:stw_category_tree break=“li” prune=“true” onclass=“select” type=“article” killempties=“true” wraptag=“ul” />


Jon Henshaw
Internet Strategist
Sitening | Raven SEO Tools

Offline

#220 2007-05-08 04:04:10

santheo
Archived Plugin Author
From: Chicago
Registered: 2004-05-27
Posts: 62
Website

Re: [Archived] stw_category_tree

jonhenshaw wrote:

I’ve read through this thread and haven’t been able to find an answer to my problem. stw_category_tree works great, except I really want to remove “category” from the URL.

I use a built-in TXP function called pagelinkurl to construct my category links. In the plugin it’s called from a function called stw_cat_link:

function stw_cat_link ($cat,$sec,$title) {
	return tag(str_replace("& ","&#38; ", $title),'a',' href="'.pagelinkurl(array('c'=>$cat, 's'=>$sec)).'"');
}

So if you wanted to overwrite the way category links are constructed, that’s your best bet on where to go to start tinkering. As for a way to do it from the markup, I’m afraid there isn’t a way.

Offline

#221 2007-07-12 18:24:34

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: [Archived] stw_category_tree

Sandor,

Great plugin, thanks!

Wondering if there’s a way to apply a different class to the parent and children <li>?
Doesn’t look like the plugin will do this in it’s current state…unless I’m missing something.

Is this a feature that would be difficult to add?
Would you consider an update?

If you are willing…here’s an example of possible attributes:
onclassparent=""
onclasschild=""

I’d try to mod it myself, but my programming skills aren’t quite ready.

This would allow for a lot greater CSS control over how things get hidden/shown when using javascript to create an expanding menu. I’ve been using stw_category_tree and a small bit of Javascript to create a really good tree menu. See this thread

I have the menu working pretty well here
(the rest of the store is still very much under development, just sample stuff in there now).

Thanks for your time.

Tom

Last edited by renobird (2007-07-12 18:51:34)

Offline

#222 2007-08-16 11:41:25

markusfalk
Member
Registered: 2007-08-16
Posts: 57
Website

Re: [Archived] stw_category_tree

Thank you for this very good plugin.

There is only one thing I could ask for. For the sake of Accessibilty do you think it would be possible to add the ability to wrap a strong tag around the active category and additionally remove the link? This would improve usability alot.

Furthermore, this would make it possible to identify ones location on the websites with either styles turned off or website only read by screenreader.

I have tried to adjust the plugin myself but couldn’t find my way through your code.

thanks

PS: now that I have further read trough the threads, It might also be very useful to add the ability to sort categories

:-)

Last edited by markusfalk (2007-08-16 12:00:26)


I sometimes destructively reverse engineer my own work and the only help is this forum.

visit me at visiongraphix

Offline

#223 2007-08-18 22:12:55

santheo
Archived Plugin Author
From: Chicago
Registered: 2004-05-27
Posts: 62
Website

Re: [Archived] stw_category_tree

Markus-

Glad you enjoy the plugin. Thanks for using it.

I don’t have any plans to add a strong tag and remove the link as part of the standard set-up; however, I’d be happy to tell you which lines of PHP to change to make it work this way on your set-up. I won’t be able to do it today, but I’ll try to get it it in the next couple weeks.

Renobird, I’ll see what I can do about that. I might not implement it exactly the way you describe, but I don’t see why I couldn’t add an additional class to the parent and child LIs.

-Sandy

Offline

#224 2007-09-07 07:53:36

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: [Archived] stw_category_tree

Hi, thanks for the usefull plugin.

Just to complete up. In Debugging some empty variable complaints:

tag_error <txp:stw_category_tree section=“topics” type=“article” maxlevel=“1” /> -> Notice: Undefined variable: type on line 76
textpattern/lib/txplib_misc.php(534) : eval()’d code:45 stw_make_tree()
textpattern/publish.php:963 stw_category_tree()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php:1383 parse()
textpattern/publish/taghandlers.php:243 parse_form()
textpattern/publish.php:963 output_form()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/publish.php:456 parse()
tag_error <txp:stw_category_tree section=“topics” type=“article” maxlevel=“1” /> -> Notice: Undefined variable: count_subtotal on line 77
textpattern/lib/txplib_misc.php(534) : eval()’d code:45 stw_make_tree()
textpattern/publish.php:963 stw_category_tree()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php:1383 parse()
textpattern/publish/taghandlers.php:243 parse_form()
textpattern/publish.php:963 output_form()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/publish.php:456 parse()
tag_error <txp:stw_category_tree section=“topics” type=“article” maxlevel=“1” /> -> Notice: Undefined variable: type on line 76
textpattern/lib/txplib_misc.php(534) : eval()’d code:45 stw_make_tree()
textpattern/publish.php:963 stw_category_tree()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php:1383 parse()
textpattern/publish/taghandlers.php:243 parse_form()
textpattern/publish.php:963 output_form()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/publish.php:456 parse()
tag_error <txp:stw_category_tree section=“topics” type=“article” maxlevel=“1” /> -> Notice: Undefined variable: type on line 76
textpattern/lib/txplib_misc.php(534) : eval()’d code:45 stw_make_tree()
textpattern/publish.php:963 stw_category_tree()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php:1383 parse()
textpattern/publish/taghandlers.php:243 parse_form()
textpattern/publish.php:963 output_form()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/publish.php:456 parse()
tag_error <txp:stw_category_tree section=“topics” type=“article” maxlevel=“1” /> -> Notice: Undefined variable: type on line 76
textpattern/lib/txplib_misc.php(534) : eval()’d code:45 stw_make_tree()
textpattern/publish.php:963 stw_category_tree()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php:1383 parse()
textpattern/publish/taghandlers.php:243 parse_form()
textpattern/publish.php:963 output_form()
processTags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/publish.php:456 parse()

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#225 2007-09-16 15:42:22

alexwest
Member
From: Järna, Sweden
Registered: 2004-08-04
Posts: 53

Re: [Archived] stw_category_tree

Hi,

Just been updating a website where I am using this plugin and I am finding that it would be great to add a ‘sort’ attribute to the display of categories. Basically, the plugin is sorting by name and I would like to have the possibility to sort by title also. Sure it takes just a few lines of code somewhere.

Thankfully,
Alex


be safe and happy

Offline

Board footer

Powered by FluxBB