Replacing the content on the users page

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

Replacing the content on the users page

ttronslien
Can anyone point me in the direction on how I can 

a) remove the user search (for the page .Users) and
b) add a node (with a view for a custom search?)

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)

Thanks

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499

---

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=691894

(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: Replacing the content on the users page

Jay Dansand

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: 920-832-6585

               Fax:    920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [mailto:[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)

 

Thanks


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499

---

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

To unsubscribe click here: http://lists.middlebury.edu/u?id=849053.214f550f57fa54a976b5f2d087b6d379&n=T&l=monster_menus&o=691894

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

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=691895

(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: Replacing the content on the users page

Dan Wilga-2
In reply to this post by ttronslien
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.

On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: 920-832-6585

               Fax:    920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)

 

Thanks


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499



---

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=691896

(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: Replacing the content on the users page

ttronslien
In reply to this post by ttronslien
Thanks for quick responses.

I'm not having much luck. I have tried two different configurations.

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

function lu_functions_mm_showpage_routing() {

  $items = array();
  $items['users'] = array(
    'page callback' => 'no_nodes',

  );
  return $items;
}

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'node/16743',
  );

  return $items;
}


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.


On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a href="tel:920-832-6585" value="+19208326585" target="_blank">920-832-6585

               Fax:    <a href="tel:920-832-7693" value="+19208327693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)

 

Thanks


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499



---

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

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=691896

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

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=691897

(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: Replacing the content on the users page

Dan Wilga-2
In reply to this post by ttronslien
Hi Tove,

You missed a little bit of the concept of page callbacks: they are functions. Try this:

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'lu_users_page',
  );
  return $items;
}

function lu_users_page() {
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

On 8/13/13 10:52 AM, Tove Tronslien wrote:
Thanks for quick responses.

I'm not having much luck. I have tried two different configurations.

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

function lu_functions_mm_showpage_routing() {

  $items = array();
  $items['users'] = array(
    'page callback' => 'no_nodes',

  );
  return $items;
}

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'node/16743',
  );

  return $items;
}


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.


On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a moz-do-not-send="true" href="tel:920-832-6585" value="+19208326585" target="_blank">920-832-6585

               Fax:    <a moz-do-not-send="true" href="tel:920-832-7693" value="+19208327693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)



---

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=691898

(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: Replacing the content on the users page

ttronslien
In reply to this post by ttronslien
Thanks Dan, this was of great help.
I now have my custom content showing

BUT, the default user search, as provided by monster menu (searching on username) is still appearing, also when applying your code without alterations. Any logged in users can see the user search, but it is not suitable for every logged in user group :) Suggestions?

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Tue, Aug 13, 2013 at 11:02 AM, Dan Wilga <[hidden email]> wrote:
Hi Tove,

You missed a little bit of the concept of page callbacks: they are functions. Try this:

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'lu_users_page',
  );
  return $items;
}

function lu_users_page() {
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

On 8/13/13 10:52 AM, Tove Tronslien wrote:
Thanks for quick responses.

I'm not having much luck. I have tried two different configurations.

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

function lu_functions_mm_showpage_routing() {

  $items = array();
  $items['users'] = array(
    'page callback' => 'no_nodes',

  );
  return $items;
}

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'node/16743',
  );

  return $items;
}


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.


On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a href="tel:920-832-6585" value="+19208326585" target="_blank">920-832-6585

               Fax:    <a href="tel:920-832-7693" value="+19208327693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)



---

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

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=691898

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

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=691899

(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: Replacing the content on the users page

Dan Wilga-2
In reply to this post by ttronslien
Short of changing MM, the only (hackish) way I can see of doing this would be to find a role for which the 'access user profiles' permission is disabled, and set $user to a user in that role. So if the anonymous user fits the bill, then:

function lu_users_page() {
  global $user;
  $user = user_load(0);
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

Of course, this could have adverse effects on other parts of your custom search form.

If you want to make a modification to MM, the code to comment-out is at line 1489 of misc.inc:

  elseif ((count($mmtids) == 1 || count($mmtids) == 2 && variable_get('mm_use_virtual_user_dir', TRUE)) && $mmtids[0] == mm_content_users_mmtid()) {
    module_load_include('inc', 'monster_menus', 'mm_ui_user_list');
    $output[] = mm_ui_user_list_form($mmtids);
    $ok++;
  }

On 8/13/13 11:53 AM, Tove Tronslien wrote:
Thanks Dan, this was of great help.
I now have my custom content showing

BUT, the default user search, as provided by monster menu (searching on username) is still appearing, also when applying your code without alterations. Any logged in users can see the user search, but it is not suitable for every logged in user group :) Suggestions?

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Tue, Aug 13, 2013 at 11:02 AM, Dan Wilga <[hidden email]> wrote:
Hi Tove,

You missed a little bit of the concept of page callbacks: they are functions. Try this:

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'lu_users_page',
  );
  return $items;
}

function lu_users_page() {
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

On 8/13/13 10:52 AM, Tove Tronslien wrote:
Thanks for quick responses.

I'm not having much luck. I have tried two different configurations.

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

function lu_functions_mm_showpage_routing() {

  $items = array();
  $items['users'] = array(
    'page callback' => 'no_nodes',

  );
  return $items;
}

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'node/16743',
  );

  return $items;
}


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a moz-do-not-send="true" href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.


On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a moz-do-not-send="true" href="tel:920-832-6585" value="+19208326585" target="_blank">920-832-6585

               Fax:    <a moz-do-not-send="true" href="tel:920-832-7693" value="+19208327693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)



---

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=691900

(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: Replacing the content on the users page

ttronslien
In reply to this post by ttronslien
The problem is still though that even with the code below implemented, the default search script is loading. Regardless of user role.

 return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));

See image attached, which shows the code and the rendered page.

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Tue, Aug 13, 2013 at 12:39 PM, Dan Wilga <[hidden email]> wrote:
Short of changing MM, the only (hackish) way I can see of doing this would be to find a role for which the 'access user profiles' permission is disabled, and set $user to a user in that role. So if the anonymous user fits the bill, then:

function lu_users_page() {
  global $user;
  $user = user_load(0);

  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

Of course, this could have adverse effects on other parts of your custom search form.

If you want to make a modification to MM, the code to comment-out is at line 1489 of misc.inc:

  elseif ((count($mmtids) == 1 || count($mmtids) == 2 && variable_get('mm_use_virtual_user_dir', TRUE)) && $mmtids[0] == mm_content_users_mmtid()) {
    module_load_include('inc', 'monster_menus', 'mm_ui_user_list');
    $output[] = mm_ui_user_list_form($mmtids);
    $ok++;

  }

On 8/13/13 11:53 AM, Tove Tronslien wrote:
Thanks Dan, this was of great help.
I now have my custom content showing

BUT, the default user search, as provided by monster menu (searching on username) is still appearing, also when applying your code without alterations. Any logged in users can see the user search, but it is not suitable for every logged in user group :) Suggestions?

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Tue, Aug 13, 2013 at 11:02 AM, Dan Wilga <[hidden email]> wrote:
Hi Tove,

You missed a little bit of the concept of page callbacks: they are functions. Try this:

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'lu_users_page',
  );
  return $items;
}

function lu_users_page() {
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

On 8/13/13 10:52 AM, Tove Tronslien wrote:
Thanks for quick responses.

I'm not having much luck. I have tried two different configurations.

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

function lu_functions_mm_showpage_routing() {

  $items = array();
  $items['users'] = array(
    'page callback' => 'no_nodes',

  );
  return $items;
}

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'node/16743',
  );

  return $items;
}


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.


On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a href="tel:920-832-6585" value="+19208326585" target="_blank">920-832-6585

               Fax:    <a href="tel:920-832-7693" value="+19208327693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)



---

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

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=691900

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

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=691901

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

or send a blank email to [hidden email]


Screen Shot 2013-08-13 at 12.50.49 PM.png (94K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Replacing the content on the users page

Jay Dansand
In reply to this post by ttronslien

So, going by Dan’s advice, that means the “Anonymous” role has ‘access user profiles’ permission.  The point being, if you have a role available that does *not* have that permission, you can switch the global $user object to a user in that role at runtime, thus preventing MM from rendering the generated user profiles code.  If Anonymous has that permission though, switching the user to anonymous ($user = user_load(0)) will not work as described.

 

Incidentally, there’s an issue w/proposed functionality at https://drupal.org/node/2049555 that would allow your code to solve this exact problem J  We’re currently using it to replace pages with Panels layouts of the page’s nodes, iff the page has been Panelized – normal pages get rendered through the typical pipeline.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: 920-832-6585

               Fax:    920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [mailto:[hidden email]]
Sent: Tuesday, August 13, 2013 11:52 AM
To: Monster Menus Development
Subject: Re: Replacing the content on the users page

 

The problem is still though that even with the code below implemented, the default search script is loading. Regardless of user role.

 

 return array('no_nodes' => TRUE,

     'output_pre' => array('#markup' => 'This is a test'));

 

See image attached, which shows the code and the rendered page.

 

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499

 

On Tue, Aug 13, 2013 at 12:39 PM, Dan Wilga <[hidden email]> wrote:

Short of changing MM, the only (hackish) way I can see of doing this would be to find a role for which the 'access user profiles' permission is disabled, and set $user to a user in that role. So if the anonymous user fits the bill, then:

function lu_users_page() {
  global $user;
  $user = user_load(0);


  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

Of course, this could have adverse effects on other parts of your custom search form.

If you want to make a modification to MM, the code to comment-out is at line 1489 of misc.inc:

  elseif ((count($mmtids) == 1 || count($mmtids) == 2 && variable_get('mm_use_virtual_user_dir', TRUE)) && $mmtids[0] == mm_content_users_mmtid()) {
    module_load_include('inc', 'monster_menus', 'mm_ui_user_list');
    $output[] = mm_ui_user_list_form($mmtids);
    $ok++;


  }

On 8/13/13 11:53 AM, Tove Tronslien wrote:

Thanks Dan, this was of great help.

I now have my custom content showing

 

BUT, the default user search, as provided by monster menu (searching on username) is still appearing, also when applying your code without alterations. Any logged in users can see the user search, but it is not suitable for every logged in user group :) Suggestions?


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" target="_blank">(807) 343-8499

 

On Tue, Aug 13, 2013 at 11:02 AM, Dan Wilga <[hidden email]> wrote:

Hi Tove,

You missed a little bit of the concept of page callbacks: they are functions. Try this:

function lu_functions_mm_showpage_routing() {

  $items = array();

  $items['users'] = array(

    'page callback' => 'lu_users_page',

  );

  return $items;

}

function lu_users_page() {
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}


On 8/13/13 10:52 AM, Tove Tronslien wrote:

Thanks for quick responses.

 

I'm not having much luck. I have tried two different configurations.

 

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

 

function lu_functions_mm_showpage_routing() {

 

  $items = array();

  $items['users'] = array(

    'page callback' => 'no_nodes',

 

  );

  return $items;

}

 

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

 

function lu_functions_mm_showpage_routing() {

  $items = array();

  $items['users'] = array(

    'page callback' => 'node/16743',

  );

 

  return $items;

}

 


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" target="_blank">(807) 343-8499

 

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:

Jay hit the nail right on the head. In fact, that's the only way I can see to do it.



On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a href="tel:920-832-6585" target="_blank">920-832-6585

               Fax:    <a href="tel:920-832-7693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)

 

 

---

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

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=691900

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

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=849053.214f550f57fa54a976b5f2d087b6d379&n=T&l=monster_menus&o=691901

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

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=691902

(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: Replacing the content on the users page

Dan Wilga-2
In reply to this post by ttronslien
Yes, and the solutions I gave (modifying $user or MM itself) should prevent this. But there are tradeoffs, as I noted.

On 8/13/13 12:51 PM, Tove Tronslien wrote:
The problem is still though that even with the code below implemented, the default search script is loading. Regardless of user role.

 return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));

See image attached, which shows the code and the rendered page.

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Tue, Aug 13, 2013 at 12:39 PM, Dan Wilga <[hidden email]> wrote:
Short of changing MM, the only (hackish) way I can see of doing this would be to find a role for which the 'access user profiles' permission is disabled, and set $user to a user in that role. So if the anonymous user fits the bill, then:

function lu_users_page() {
  global $user;
  $user = user_load(0);

  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

Of course, this could have adverse effects on other parts of your custom search form.

If you want to make a modification to MM, the code to comment-out is at line 1489 of misc.inc:

  elseif ((count($mmtids) == 1 || count($mmtids) == 2 && variable_get('mm_use_virtual_user_dir', TRUE)) && $mmtids[0] == mm_content_users_mmtid()) {
    module_load_include('inc', 'monster_menus', 'mm_ui_user_list');
    $output[] = mm_ui_user_list_form($mmtids);
    $ok++;

  }

On 8/13/13 11:53 AM, Tove Tronslien wrote:
Thanks Dan, this was of great help.
I now have my custom content showing

BUT, the default user search, as provided by monster menu (searching on username) is still appearing, also when applying your code without alterations. Any logged in users can see the user search, but it is not suitable for every logged in user group :) Suggestions?

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a moz-do-not-send="true" href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Tue, Aug 13, 2013 at 11:02 AM, Dan Wilga <[hidden email]> wrote:
Hi Tove,

You missed a little bit of the concept of page callbacks: they are functions. Try this:

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'lu_users_page',
  );
  return $items;
}

function lu_users_page() {
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

On 8/13/13 10:52 AM, Tove Tronslien wrote:
Thanks for quick responses.

I'm not having much luck. I have tried two different configurations.

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

function lu_functions_mm_showpage_routing() {

  $items = array();
  $items['users'] = array(
    'page callback' => 'no_nodes',

  );
  return $items;
}

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'node/16743',
  );

  return $items;
}


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a moz-do-not-send="true" href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.


On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a moz-do-not-send="true" href="tel:920-832-6585" value="+19208326585" target="_blank">920-832-6585

               Fax:    <a moz-do-not-send="true" href="tel:920-832-7693" value="+19208327693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)



---

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=691903

(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: Replacing the content on the users page

ttronslien
In reply to this post by ttronslien
Thanks for all the input.
I ended up with commenting out the following rows in misc.inc
//module_load_include('inc', 'monster_menus', 'mm_ui_user_list');
//$output[] = mm_ui_user_list_form($mmtids);

This was the solution that worked best for me - for now.




Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
(807) 343-8499


On Tue, Aug 13, 2013 at 12:56 PM, Dan Wilga <[hidden email]> wrote:
Yes, and the solutions I gave (modifying $user or MM itself) should prevent this. But there are tradeoffs, as I noted.


On 8/13/13 12:51 PM, Tove Tronslien wrote:
The problem is still though that even with the code below implemented, the default search script is loading. Regardless of user role.

 return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));

See image attached, which shows the code and the rendered page.

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Tue, Aug 13, 2013 at 12:39 PM, Dan Wilga <[hidden email]> wrote:
Short of changing MM, the only (hackish) way I can see of doing this would be to find a role for which the 'access user profiles' permission is disabled, and set $user to a user in that role. So if the anonymous user fits the bill, then:

function lu_users_page() {
  global $user;
  $user = user_load(0);

  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

Of course, this could have adverse effects on other parts of your custom search form.

If you want to make a modification to MM, the code to comment-out is at line 1489 of misc.inc:

  elseif ((count($mmtids) == 1 || count($mmtids) == 2 && variable_get('mm_use_virtual_user_dir', TRUE)) && $mmtids[0] == mm_content_users_mmtid()) {
    module_load_include('inc', 'monster_menus', 'mm_ui_user_list');
    $output[] = mm_ui_user_list_form($mmtids);
    $ok++;

  }

On 8/13/13 11:53 AM, Tove Tronslien wrote:
Thanks Dan, this was of great help.
I now have my custom content showing

BUT, the default user search, as provided by monster menu (searching on username) is still appearing, also when applying your code without alterations. Any logged in users can see the user search, but it is not suitable for every logged in user group :) Suggestions?

Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499


On Tue, Aug 13, 2013 at 11:02 AM, Dan Wilga <[hidden email]> wrote:
Hi Tove,

You missed a little bit of the concept of page callbacks: they are functions. Try this:

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'lu_users_page',
  );
  return $items;
}

function lu_users_page() {
  return array('no_nodes' => TRUE,
     'output_pre' => array('#markup' => 'This is a test'));
}

On 8/13/13 10:52 AM, Tove Tronslien wrote:
Thanks for quick responses.

I'm not having much luck. I have tried two different configurations.

First attempt should have removed the default user search by executing the code below. However, it did not. I'm not so sure though that the, user search, is a regular node as I see the form API being built within Monster Menu.

function lu_functions_mm_showpage_routing() {

  $items = array();
  $items['users'] = array(
    'page callback' => 'no_nodes',

  );
  return $items;
}

Next, I tried loading my new node at no avail. I did rebuild the menu tree and clear cache in between each attempt.

function lu_functions_mm_showpage_routing() {
  $items = array();
  $items['users'] = array(
    'page callback' => 'node/16743',
  );

  return $items;
}


Tove Tronslien, MSc, Informatics
Manager, Web Development Services
Lakehead University
Thunder Bay | Orillia, Ontario, Canada
[hidden email]
<a href="tel:%28807%29%20343-8499" value="+18073438499" target="_blank">(807) 343-8499

On Tue, Aug 13, 2013 at 10:12 AM, Dan Wilga <[hidden email]> wrote:
Jay hit the nail right on the head. In fact, that's the only way I can see to do it.


On 8/13/13 9:30 AM, Jay Dansand wrote:

I’d suggest a look at hook_mm_showpage_routing().  It allows you to basically define a path like hook_menu() and change the output (add your own content to the output, remove default content via the “no_nodes” return option).  See mm_api.inc for more info.

 

 

Regards,

Jay Dansand, LU '08

 

--

.-.   .-..-.   Senior Web Application Developer

| |__ | || |   Lawrence University ITS

`----'`----'   Office: <a href="tel:920-832-6585" value="+19208326585" target="_blank">920-832-6585

               Fax:    <a href="tel:920-832-7693" value="+19208327693" target="_blank">920-832-7693

               E-mail: [hidden email]

 

From: Tove Tronslien [[hidden email]]
Sent: Tuesday, August 13, 2013 8:27 AM
To: Monster Menus Development
Subject: Replacing the content on the users page

 

Can anyone point me in the direction on how I can 

 

a) remove the user search (for the page .Users) and

b) add a node (with a view for a custom search?)

 

I tried to Add the node using the contents tab, and while node's Pages indicates it being on User List page, it is still not appearing (Piece of contents to display at one time is set to (display all content immediately)  under Page Settings)



---

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

To unsubscribe click here: http://lists.middlebury.edu/u?id=857556.923faf2f511f9d2b6990f78983c62c3e&n=T&l=monster_menus&o=691903

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

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=691939

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

or send a blank email to [hidden email]

Loading...