1
amok200
wfsection - changing select box to order by weight not alphabetically ?
  • 2004/3/14 10:06

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


Hi,

How do I change the select box in wfsections (which I'm using to navigate sub-categories) to be ordered by weight instead of alphabetically ? This way I can control the order and make it more logical.

Thanks,

amok

2
amok200
Re: wfsection - changing select box to order by weight not alphabetically ?
  • 2004/3/15 15:16

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


Sorry to bump my own post up to the top .. but I've looked through the wfsection code and still cant find this. I guess it's just putting an ORDER BY weight statement on the end of a SQL statement, but I can't find it.

Would really appreciate some help from a mod developer or someone knowledgable about wfsections.

Thanks much,

amok

3
amok200
Re: wfsection - changing select box to order by weight not alphabetically ?
  • 2004/3/15 17:49

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


OK after more digging around I've found the select box code in index.php - could someone help me with the php to make these options orderby weight ?

The code section is:

// -- Skalpack2 [start]
$jump = XOOPS_URL."/modules/wfsection/index.php?";
$tree = new wfsTree($xt->table, "id", "pid");
switch ($wfsConfig['aidxpathtype']) {
case 1: // Local selectbox
$tree->makeMyRootedSelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value");
break;
case 2: // Linked path
echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->id, "title", $jump));
break;
case 3: // Path and local select box
echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->pid, "title", $jump));
$tree->makeMyRootedSelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value");
break;
case 4: // None
break;
case 0: // Full selectbox
default:
$xt->makeSelBox(1, $xt->id, "pid", "location.href='{$jump}category='+this.options[this.selectedIndex].value")."";
break;
}
// -- Skalpack2 [/end] echo "";

Thanks,

amok

4
JackJ
Re: wfsection - changing select box to order by weight not alphabetically ?
  • 2004/3/15 18:00

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


amok200

To order articles by weight on the index page you go to wfsection "configuration" and choose:

Type of navigation tool "Select box " (or whatever)

Article sort order " Weight"

Then you need to go to "weight management" in configuration and click on the title of your section. Then add weighting to the article list that appears ie

1
2
3
etc

regards

5
amok200
Re: wfsection - changing select box to order by weight not alphabetically ?
  • 2004/3/15 19:03

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


Hi JackJ,

It's good to hear from you - you've been very helpful in the past and I hope you can help again !

Thanks so much for the response, however it does not unfortunately address the problem, sorry. Articles are sorted by weight with no difficulty, but what I am trying to do is sort subcategories by weight WITHIN a select box.

For example, if you create the following in section management and assign weights in weight management

cat1
cat1sub1 (weight=1)
cat1sub2 (weight=2)

The sub category weights take effect on the index page, but not when you go into cat1 and choose the select box. In that case they are still sorted alphabetically, and the weight settings are ignored.

So what I'm trying to do is figure out how to edit index.php (or whatever I need to edit) so that the select box code can sort entries by weight.

Thanks !

amok

Login

Who's Online

391 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 391


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits