Topic: &hereClass not showing for a weblink?  (Read 3251 times)

Pages: [1]   Go Down

#1: 30-Aug-2008, 12:18 PM

lmentop
Posts: 3

My menu is working correctly with the exception of setting the hereClass for my main page and when you click the home link. All other pages work fine.

This is the code I'm using.
Code:
[[Wayfinder? &startId=`[[UltimateParent]]` &level=`1` &webLinkClass=`` &rowClass=`` &levelClass=`` &firstClass=`` &lastClass=`` &selfClass=`` &useWeblinkUrl=`false`]]

On my document tree I have my main page, with the weblink and other pages just below it. The weblink calls on the main document's ID and I tried using the full page address too.

All other pages get assigned the class "active" when their links are selected.

What am I missing?
http://www.law.gmu.edu/org/els
« Last Edit: 30-Aug-2008, 12:21 PM by lmentop »

#2: 30-Aug-2008, 01:16 PM

Coding Team

sottwell
Posts: 10,439

WWW
That's because the page you get when a weblink is selected is not the actual weblink document; rather it's the document the weblink points to.
sottwell.com has moved to a lovely Solaris 10 server!
Log in username guest, password guestuser.
Templates are now becoming available at http://sottwell.com/templates.html

#3: 30-Aug-2008, 02:03 PM

lmentop
Posts: 3

Is there anyway around it or an easy way to get it to work?

#4: 2-Sep-2008, 03:15 PM

lmentop
Posts: 3

A friend solved it by adding an id for each element pertaining to its page number and setting a template variable to add some extra css just on the front page to set the link to be active...

it makes sense to me...

#5: 13-Nov-2008, 04:52 AM

Guest
Hi there.

i solve this problem by small Wf hack. there is:

in assets/snippets/wayfinder/wayfinder.inc.php in function isHere($did) (near 268 line) i change code like this
Code:
    function isHere($did) {
// begin weblink 'here' patch
global $modx;
$doc = $modx->getDocumentObject('id', $did);
if ($doc['type'] == 'reference')
  $did = $doc['content'];
// end weblink 'here' patch
        return in_array($did,$this->parentTree);
    }


work fine by me, but now i think how to minimize getDocumentObject() calls and do it only for documents with type='reference'. It's can be done just add one param $type='document' to isHere() function and change their call in 248 line of wayfinder.inc.php. May be it's will be better that the current solution.

Hope it's help anybody.

King regards!

#6: 25-Mar-2009, 05:53 AM

jonasfr
Posts: 3

As far as i've tested you're changes there are occuring problems with sorting on mysql version 4.1 when there is a SELECT DISTINCT without a GROUP BY statement, so i just added the GROUP BY clause on line 380, but i think this will make problems in mysql version 5 so if there is anybody who got a solution working for every version... let me know

Code:
$sql = "SELECT DISTINCT {$fields} FROM {$tblsc} sc LEFT JOIN {$tbldg} dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND ({$access}){$menuWhere} AND sc.id IN (".implode(',',$ids).") GROUP BY sc.id ORDER BY {$sort} {$this->_config['sortOrder']} {$sqlLimit};";
Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.