Quantcast

Sorting of mm views

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sorting of mm views

grahamtk
This post has NOT been accepted by the mailing list yet.
Hi!
I have a news slider that is a view on this page:
http://www.nmbu.no/forskning/tema/mat

it is filtered by a contextual filter (MM nodes on MM page) sorted by mm page weight asc and node weight asc.

Should it not be same order as the nodes appear on the mm page from where it is fetched?
http://www.nmbu.no/forskning/tema/mat/nyheter
currently they are not. The nodes appear on more than one page, could that affect the sorting?

this is the sql produced by views:

SELECT DISTINCT node.nid AS nid, node.title AS node_title, mm_tree.sort_idx AS mm_tree_sort_idx, mm_node_reorder.weight AS mm_node_reorder_weight, 'node' AS field_data_field_umb_ingressbilde_node_entity_type, 'node' AS field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT node.nid) AS nid_1
FROM
{node} node
INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
LEFT JOIN {mm_tree} mm_tree ON mm_node2tree.mmtid = mm_tree.mmtid
LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid = mm_node_reorder.nid
WHERE (( (mm_node2tree.mmtid = '836') )AND(( (node.type IN  ('umb_article')) AND (node.status = '1') )))
GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type, field_data_field_umb_article_ingress_node_entity_type
ORDER BY mm_tree_sort_idx ASC, mm_node_reorder_weight ASC
LIMIT 5 OFFSET 0


Best,
Øyvind Graham
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting of mm views

Dan Wilga-2
Ah, a question I can answer easily, as I just wrote a view to do this
very thing. You don't want to use MM Page Weight; that is the order of
MM pages within the tree, not nodes. Instead, to emulate what MM itself
does, use:

Content: Sticky (desc)
MM: Node weight (MM) (asc)
Content: Updated date (desc)

On 11/18/14 8:31 AM, grahamtk wrote:

> Hi!
> I have a news slider that is a view on this page:
> http://www.nmbu.no/forskning/tema/mat
>
> it is filtered by a contextual filter (MM nodes on MM page) sorted by mm
> page weight asc and node weight asc.
>
> Should it not be same order as the nodes appear on the mm page from where it
> is fetched?
> http://www.nmbu.no/forskning/tema/mat/nyheter
> currently they are not. The nodes appear on more than one page, could that
> affect the sorting?
>
> this is the sql produced by views:
>
> SELECT DISTINCT node.nid AS nid, node.title AS node_title, mm_tree.sort_idx
> AS mm_tree_sort_idx, mm_node_reorder.weight AS mm_node_reorder_weight,
> 'node' AS field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_tree} mm_tree ON mm_node2tree.mmtid = mm_tree.mmtid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '836') )AND(( (node.type IN  ('umb_article'))
> AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> field_data_field_umb_article_ingress_node_entity_type
> ORDER BY mm_tree_sort_idx ASC, mm_node_reorder_weight ASC
> LIMIT 5 OFFSET 0
>
>
> Best,
> Øyvind Graham
>
>
>
> --
> View this message in context: http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001.html
> Sent from the Monster Menus mailing list archive at Nabble.com.
>
> ---
> You are currently subscribed to monster_menus as: [hidden email].
> To unsubscribe click here: http://lists.middlebury.edu/u?id=685500.19fa7de7038497527f6a88cf1629251d&n=T&l=monster_menus&o=708439
> or send a blank email to [hidden email]


---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708443
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
In reply to this post by grahamtk
Thanks a lot for the swift reply!
It works!

I think that some of the questions I post here should have been posted on
drupal.org/project/monster_menus as support requests instead?
I apologize for my bad habits.

Should I, for the sake of documentation on d.o
Re-post my most support like questions in the mailinglist archive as support issues there?

Best,
Øyvind Graham

-----Original Message-----
From: Dan Wilga [mailto:[hidden email]]
Sent: Tuesday, November 18, 2014 3:23 PM
To: Monster Menus Development
Subject: Re: Sorting of mm views

Ah, a question I can answer easily, as I just wrote a view to do this very thing. You don't want to use MM Page Weight; that is the order of MM pages within the tree, not nodes. Instead, to emulate what MM itself does, use:

Content: Sticky (desc)
MM: Node weight (MM) (asc)
Content: Updated date (desc)

On 11/18/14 8:31 AM, grahamtk wrote:

> Hi!
> I have a news slider that is a view on this page:
> http://www.nmbu.no/forskning/tema/mat
>
> it is filtered by a contextual filter (MM nodes on MM page) sorted by
> mm page weight asc and node weight asc.
>
> Should it not be same order as the nodes appear on the mm page from
> where it is fetched?
> http://www.nmbu.no/forskning/tema/mat/nyheter
> currently they are not. The nodes appear on more than one page, could
> that affect the sorting?
>
> this is the sql produced by views:
>
> SELECT DISTINCT node.nid AS nid, node.title AS node_title,
> mm_tree.sort_idx AS mm_tree_sort_idx, mm_node_reorder.weight AS
> mm_node_reorder_weight, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_tree} mm_tree ON mm_node2tree.mmtid = mm_tree.mmtid LEFT
> JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid WHERE (( (mm_node2tree.mmtid = '836') )AND((
> (node.type IN  ('umb_article')) AND (node.status = '1') ))) GROUP BY
> nid, field_data_field_umb_ingressbilde_node_entity_type,
> field_data_field_umb_article_ingress_node_entity_type
> ORDER BY mm_tree_sort_idx ASC, mm_node_reorder_weight ASC LIMIT 5
> OFFSET 0
>
>
> Best,
> Øyvind Graham
>
>
>
> --
> View this message in context:
> http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp75730
> 01.html Sent from the Monster Menus mailing list archive at
> Nabble.com.
>
> ---
> You are currently subscribed to monster_menus as: [hidden email].
> To unsubscribe click here:
> http://lists.middlebury.edu/u?id=685500.19fa7de7038497527f6a88cf162925
> 1d&n=T&l=monster_menus&o=708439 or send a blank email to
> [hidden email].
> edu


---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=1410382.5af74b4693b81b84495f479a03f0e1ec&n=T&l=monster_menus&o=708443
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708445
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting of mm views

Dan Wilga-2
In reply to this post by grahamtk
I'd say you should probably post questions (like this one) that might be
of interest to others on drupal.org, yes. If it's a very detailed
question about the inner workings of a particular function, then this
list is probably better.

On 11/18/14 10:57 AM, Øyvind Graham wrote:

> Thanks a lot for the swift reply!
> It works!
>
> I think that some of the questions I post here should have been posted on
> drupal.org/project/monster_menus as support requests instead?
> I apologize for my bad habits.
>
> Should I, for the sake of documentation on d.o
> Re-post my most support like questions in the mailinglist archive as support issues there?
>
> Best,
> Øyvind Graham
>
> -----Original Message-----
> From: Dan Wilga [mailto:[hidden email]]
> Sent: Tuesday, November 18, 2014 3:23 PM
> To: Monster Menus Development
> Subject: Re: Sorting of mm views
>
> Ah, a question I can answer easily, as I just wrote a view to do this very thing. You don't want to use MM Page Weight; that is the order of MM pages within the tree, not nodes. Instead, to emulate what MM itself does, use:
>
> Content: Sticky (desc)
> MM: Node weight (MM) (asc)
> Content: Updated date (desc)
>
> On 11/18/14 8:31 AM, grahamtk wrote:
>> Hi!
>> I have a news slider that is a view on this page:
>> http://www.nmbu.no/forskning/tema/mat
>>
>> it is filtered by a contextual filter (MM nodes on MM page) sorted by
>> mm page weight asc and node weight asc.
>>
>> Should it not be same order as the nodes appear on the mm page from
>> where it is fetched?
>> http://www.nmbu.no/forskning/tema/mat/nyheter
>> currently they are not. The nodes appear on more than one page, could
>> that affect the sorting?
>>
>> this is the sql produced by views:
>>
>> SELECT DISTINCT node.nid AS nid, node.title AS node_title,
>> mm_tree.sort_idx AS mm_tree_sort_idx, mm_node_reorder.weight AS
>> mm_node_reorder_weight, 'node' AS
>> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
>> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
>> node.nid) AS nid_1
>> FROM
>> {node} node
>> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
>> LEFT JOIN {mm_tree} mm_tree ON mm_node2tree.mmtid = mm_tree.mmtid LEFT
>> JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
>> mm_node_reorder.nid WHERE (( (mm_node2tree.mmtid = '836') )AND((
>> (node.type IN  ('umb_article')) AND (node.status = '1') ))) GROUP BY
>> nid, field_data_field_umb_ingressbilde_node_entity_type,
>> field_data_field_umb_article_ingress_node_entity_type
>> ORDER BY mm_tree_sort_idx ASC, mm_node_reorder_weight ASC LIMIT 5
>> OFFSET 0
>>
>>
>> Best,
>> Øyvind Graham
>>
>>
>>
>> --
>> View this message in context:
>> http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp75730
>> 01.html Sent from the Monster Menus mailing list archive at
>> Nabble.com.
>>
>> ---
>> You are currently subscribed to monster_menus as: [hidden email].
>> To unsubscribe click here:
>> http://lists.middlebury.edu/u?id=685500.19fa7de7038497527f6a88cf162925
>> 1d&n=T&l=monster_menus&o=708439 or send a blank email to
>> [hidden email].
>> edu
>
> ---
> You are currently subscribed to monster_menus as: [hidden email].
> To unsubscribe click here: http://lists.middlebury.edu/u?id=1410382.5af74b4693b81b84495f479a03f0e1ec&n=T&l=monster_menus&o=708443
> or send a blank email to [hidden email]
>
> ---
> You are currently subscribed to monster_menus as: [hidden email].
> To unsubscribe click here: http://lists.middlebury.edu/u?id=685500.19fa7de7038497527f6a88cf1629251d&n=T&l=monster_menus&o=708445
> or send a blank email to [hidden email]


---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708486
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting of mm views

grahamtk
This however, is not a support question I think,

To me it seems the relation to mm_node_reorder should be joined both on
mmtid and node id,
Else we can not be sure the matched nid is the ordering row from the correct
page.

this join should also match on mmtid?
LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
mm_node_reorder.nid


SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
node.nid) AS nid_1
FROM
{node} node
INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
mm_node_reorder.nid
WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
('umb_article')) AND (node.status = '1') )))
GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
node_title, field_data_field_umb_article_ingress_node_entity_type,
mm_node_reorder_weight, node_changed
ORDER BY mm_node_reorder_weight ASC, node_changed DESC
LIMIT 5 OFFSET 0





--
View this message in context: http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573006.html
Sent from the Monster Menus mailing list archive at Nabble.com.

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708529
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting of mm views

grahamtk
This post has NOT been accepted by the mailing list yet.
In reply to this post by Dan Wilga-2
This however, is not a support question I think,

To me it seems the relation to mm_node_reorder should be joined both on mmtid and node id,
Else we can not be sure the matched nid is the ordering row from the correct page.

this join should also match on mmtid?
LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid = mm_node_reorder.nid


SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS mm_node_reorder_weight, node.changed AS node_changed, 'node' AS field_data_field_umb_ingressbilde_node_entity_type, 'node' AS field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT node.nid) AS nid_1
FROM
{node} node
INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid = mm_node_reorder.nid
WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN  ('umb_article')) AND (node.status = '1') )))
GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type, node_title, field_data_field_umb_article_ingress_node_entity_type, mm_node_reorder_weight, node_changed
ORDER BY mm_node_reorder_weight ASC, node_changed DESC
LIMIT 5 OFFSET 0

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting of mm views

Dan Wilga-2
In reply to this post by grahamtk
The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:

> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>


---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708532
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
This post has NOT been accepted by the mailing list yet.

Why is this done in mm rendering of pages then?

 

"LEFT JOIN {mm_node_reorder} r ON r.mmtid = n.mmtid AND r.nid = n.nid$add_join " .

[15:47:42] Øyvind Graham: linje 4977 i mm_content.inc

 

 

 

From: Dan Wilga [via Monster Menus] [mailto:ml-node+[hidden email]]
Sent: Wednesday, November 19, 2014 4:10 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:


> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>



---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708532
or send a blank email to [hidden email]


If you reply to this email, your message will be added to the discussion below:

http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573008.html

To start a new topic under Monster Menus, email [hidden email]
To unsubscribe from Monster Menus, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
In reply to this post by Dan Wilga-2

Why is this done in mm rendering of pages then?

 

"LEFT JOIN {mm_node_reorder} r ON r.mmtid = n.mmtid AND r.nid = n.nid$add_join " .

[15:47:42] Øyvind Graham: linje 4977 i mm_content.inc

 

 

 

From: Dan Wilga [via Monster Menus] [mailto:ml-node+[hidden email]]
Sent: Wednesday, November 19, 2014 4:10 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:


> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>



---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708532
or send a blank email to [hidden email]


If you reply to this email, your message will be added to the discussion below:

http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573008.html

To start a new topic under Monster Menus, email [hidden email]
To unsubscribe from Monster Menus, click here.
NAML



View this message in context: RE: Sorting of mm views
Sent from the Monster Menus mailing list archive at Nabble.com.

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708535

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
This post has NOT been accepted by the mailing list yet.
In reply to this post by Dan Wilga-2

I would guess because we as you state will get only one row per node because of mm_node2tree.mmtid = 7852,

But the sorting rows will be multiple per nid because they can be sorted on multiple pages,

so the sorting weight matched in the join will not necessarily match the weight from the  correct page.

 

 

From: Dan Wilga [via Monster Menus] [mailto:ml-node+[hidden email]]
Sent: Wednesday, November 19, 2014 4:10 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:


> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>



---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708532
or send a blank email to [hidden email]


If you reply to this email, your message will be added to the discussion below:

http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573008.html

To start a new topic under Monster Menus, email [hidden email]
To unsubscribe from Monster Menus, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
In reply to this post by Dan Wilga-2

I would guess because we as you state will get only one row per node because of mm_node2tree.mmtid = 7852,

But the sorting rows will be multiple per nid because they can be sorted on multiple pages,

so the sorting weight matched in the join will not necessarily match the weight from the  correct page.

 

 

From: Dan Wilga [via Monster Menus] [mailto:ml-node+[hidden email]]
Sent: Wednesday, November 19, 2014 4:10 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:


> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>



---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708532
or send a blank email to [hidden email]


If you reply to this email, your message will be added to the discussion below:

http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573008.html

To start a new topic under Monster Menus, email [hidden email]
To unsubscribe from Monster Menus, click here.
NAML



View this message in context: RE: Sorting of mm views
Sent from the Monster Menus mailing list archive at Nabble.com.

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708537

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting of mm views

Dan Wilga-2
In reply to this post by grahamtk
The difference here is that there is no mmtid filter (WHERE) outside the subquery. The clause "r.mmtid = n.mmtid" acts as the filter.

The view query, on the other hand, doesn't use a subquery, so the "WHERE mm_node2tree.mmtid=" filter affects all of the JOINs.

On 11/19/14 10:11 AM, grahamtk wrote:

Why is this done in mm rendering of pages then?

 

"LEFT JOIN {mm_node_reorder} r ON r.mmtid = n.mmtid AND r.nid = n.nid$add_join " .

[15:47:42] Øyvind Graham: linje 4977 i mm_content.inc

 

 

 

From: Dan Wilga [via Monster Menus] [[hidden email][hidden email]]
Sent: Wednesday, November 19, 2014 4:10 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:


> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>


---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708539

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
This post has NOT been accepted by the mailing list yet.

Adding the mmtid filter in the join fixes the sorting of the nodes that appears on multiple pages.

 

The slider on www.nmbu.no front page had a mix of weights from www.nmbu.no/aktuelt page and www.nmbu.no/forskning/tema/mat/nyheter page even though the filter was set on mmtid from www.nmbu.no/aktuelt page.

Now that I added a filter, only weights from www.nmbu.no/aktuelt orders the nodes on the front page slider.

 

We did this with a sql rewrite hook:

I added a tag on the view under view settings to get this hook to alter the sql.

 

function umb_article_query_alter($query) {

  if ($query->hasTag('karusell')) {

    dpm($query->getTables());

    $tables = &$query->getTables();

    $tables['mm_node_reorder']['condition'] = 'mm_node2tree.nid = mm_node_reorder.nid AND mm_node2tree.mmtid = mm_node_reorder.mmtid';

  }

}

 

 

From: Dan Wilga [via Monster Menus] [mailto:ml-node+[hidden email]]
Sent: Wednesday, November 19, 2014 4:26 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The difference here is that there is no mmtid filter (WHERE) outside the subquery. The clause "r.mmtid = n.mmtid" acts as the filter.

The view query, on the other hand, doesn't use a subquery, so the "WHERE mm_node2tree.mmtid=" filter affects all of the JOINs.

On 11/19/14 10:11 AM, grahamtk wrote:

Why is this done in mm rendering of pages then?

 

"LEFT JOIN {mm_node_reorder} r ON r.mmtid = n.mmtid AND r.nid = n.nid$add_join " .

[15:47:42] Øyvind Graham: linje 4977 i mm_content.inc

 

 

 

From: Dan Wilga [via Monster Menus] [[hidden email][hidden email]]
Sent: Wednesday, November 19, 2014 4:10 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:


> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>

 

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708539

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

 


If you reply to this email, your message will be added to the discussion below:

http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573013.html

To start a new topic under Monster Menus, email [hidden email]
To unsubscribe from Monster Menus,
click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
In reply to this post by Dan Wilga-2

Adding the mmtid filter in the join fixes the sorting of the nodes that appears on multiple pages.

 

The slider on www.nmbu.no front page had a mix of weights from www.nmbu.no/aktuelt page and www.nmbu.no/forskning/tema/mat/nyheter page even though the filter was set on mmtid from www.nmbu.no/aktuelt page.

Now that I added a filter, only weights from www.nmbu.no/aktuelt orders the nodes on the front page slider.

 

We did this with a sql rewrite hook:

I added a tag on the view under view settings to get this hook to alter the sql.

 

function umb_article_query_alter($query) {

  if ($query->hasTag('karusell')) {

    dpm($query->getTables());

    $tables = &$query->getTables();

    $tables['mm_node_reorder']['condition'] = 'mm_node2tree.nid = mm_node_reorder.nid AND mm_node2tree.mmtid = mm_node_reorder.mmtid';

  }

}

 

 

From: Dan Wilga [via Monster Menus] [mailto:ml-node+[hidden email]]
Sent: Wednesday, November 19, 2014 4:26 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The difference here is that there is no mmtid filter (WHERE) outside the subquery. The clause "r.mmtid = n.mmtid" acts as the filter.

The view query, on the other hand, doesn't use a subquery, so the "WHERE mm_node2tree.mmtid=" filter affects all of the JOINs.

On 11/19/14 10:11 AM, grahamtk wrote:

Why is this done in mm rendering of pages then?

 

"LEFT JOIN {mm_node_reorder} r ON r.mmtid = n.mmtid AND r.nid = n.nid$add_join " .

[15:47:42] Øyvind Graham: linje 4977 i mm_content.inc

 

 

 

From: Dan Wilga [via Monster Menus] [[hidden email][hidden email]]
Sent: Wednesday, November 19, 2014 4:10 PM
To: Øyvind Graham
Subject: Re: Sorting of mm views

 

The clause:

   WHERE (( (mm_node2tree.mmtid = '7852') )

ensures that only the nodes on page with mmtid=7852 will be part of the
result. There's no need to reiterate this in the LEFT JOIN.

On 11/19/14 9:43 AM, grahamtk wrote:


> This however, is not a support question I think,
>
> To me it seems the relation to mm_node_reorder should be joined both on
> mmtid and node id,
> Else we can not be sure the matched nid is the ordering row from the correct
> page.
>
> this join should also match on mmtid?
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
>
>
> SELECT node.nid AS nid, node.title AS node_title, mm_node_reorder.weight AS
> mm_node_reorder_weight, node.changed AS node_changed, 'node' AS
> field_data_field_umb_ingressbilde_node_entity_type, 'node' AS
> field_data_field_umb_article_ingress_node_entity_type, COUNT(DISTINCT
> node.nid) AS nid_1
> FROM
> {node} node
> INNER JOIN {mm_node2tree} mm_node2tree ON node.nid = mm_node2tree.nid
> LEFT JOIN {mm_node_reorder} mm_node_reorder ON mm_node2tree.nid =
> mm_node_reorder.nid
> WHERE (( (mm_node2tree.mmtid = '7852') )AND(( (node.type IN
> ('umb_article')) AND (node.status = '1') )))
> GROUP BY nid, field_data_field_umb_ingressbilde_node_entity_type,
> node_title, field_data_field_umb_article_ingress_node_entity_type,
> mm_node_reorder_weight, node_changed
> ORDER BY mm_node_reorder_weight ASC, node_changed DESC
> LIMIT 5 OFFSET 0
>

 

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708539

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

 


If you reply to this email, your message will be added to the discussion below:

http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573013.html

To start a new topic under Monster Menus, email [hidden email]
To unsubscribe from Monster Menus,
click here.
NAML



View this message in context: RE: Sorting of mm views
Sent from the Monster Menus mailing list archive at Nabble.com.

---

You are currently subscribed to monster_menus as: [hidden email].

To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708541

(It may be necessary to cut and paste the above URL if the line is broken)

or send a blank email to [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
Maybe another way would have been to rewrite the where clause in the view so
it selected on mmtid and not specifically on mm_node2tree.mmtid so it also
would match the mmtid in mm_node_reorder.mmtid?




--
View this message in context: http://monster-menus.2910260.n2.nabble.com/Sorting-of-mm-views-tp7573001p7573018.html
Sent from the Monster Menus mailing list archive at Nabble.com.

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=708604
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Sorting of mm views

grahamtk
This post has NOT been accepted by the mailing list yet.
In reply to this post by grahamtk
Maybe another way would have been to rewrite the where clause in the view so it selected on mmtid and not specifically on mm_node2tree.mmtid so it also would match the mmtid in mm_node_reorder.mmtid?
Loading...