Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#226 2007-09-17 01:03:01

applied_robert
New Member
Registered: 2007-09-17
Posts: 4

Re: [Archived] stw_category_tree

Hello!

I am using this category layout…

PrimaryCategory1
…SubCategory11
……TertiaryCategory111
…SubCategory12
PrimaryCategory2
…SubCategory21
…SubCategory22
PrimaryCategory3
…SubCategory31
PrimaryCategory4

<txp:stw_category_tree onclass="active" />

Is there any way to flag the current subcategory as “active”, if the user navigates to them? And how to do it? As I understood it, the plugin can or should do this (documentation says so… doesn’t it?) – but on my site only the related ancestors get flagged as class=“active”, whereas the current category itself does not.

E.g., if I click on SubCategory11, only PrimaryCategory1 is flagged as active, if I click on TertiaryCategory111, PrimaryCategory1 and SubCategory11 become flagged active, but TertiaryCategory111 itself never is.

Is this expected behavior, or am I missing something all to obvious..? I have been scratching my head for literally hours…
Any help greatly appreciated!

Last edited by applied_robert (2007-09-17 01:04:25)

Offline

#227 2007-09-17 08:43:05

Paul_U
Member
From: Enschede, NL
Registered: 2007-09-12
Posts: 14
Website

Re: [Archived] stw_category_tree

Hi all,

I’ve sort of combined this plugin with the wow_menu plugin, since I also needed the ability to order the categories for a site, and wow_menu lacked some of the nice features of this one (plus this plugin is easier to edit). I’m a bit unsure how to go about this sort of thing around here (do I have to ask the authors if I can use the code when doing stuff like this?), but anyway, I hope this is okay :). I bumped the version number to (hopefully) avoid version-confusion.

Also fixed the warnings in debug, and added a few attributes like ‘hide’ to exclude certain categories. I haven’t tested it fully yet (just one site), but if anyone wants to give it a try:

I think it should work fine on sites currently using stw_category_tree, since I haven’t removed any attributes. The php source can be found here:

Edit: new version, http://www.smartposition.nl/downloads/txp/ should always link to the newest from now on.

Last edited by Paul_U (2007-09-18 20:38:02)

Offline

#228 2007-09-17 15:41:30

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [Archived] stw_category_tree

Paul:
I just installed your version of the plugin. The admin looks awesome! But I have 2 problems: one (very) minor, one major

The minor one: the images for up & down in the admin tab are not there, i have to look at the status bar info to see whether it’s up or down.

The major one: after reordering and clicking on “save changes i get this error:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 0 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 1 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 2 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 3 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 4 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 5 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 6 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1 update txp_category set idx = 7 where id = in /home/.jacobina/linea/dev/textpattern/lib/txplib_db.php on line 84

New menu order saved successfully.
It does seem to save the order, but i keep getting errors.


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

Board footer

Powered by FluxBB