# Change the default group pages to /messages

**URL:** <https://meta.discourse.org/t/change-the-default-group-pages-to-messages/212123>\
**Category:** Support\
**Created:** [December 14, 2021, 11:50pm UTC](https://meta.discourse.org/t/change-the-default-group-pages-to-messages/212123 "2021-12-14T23:50:29Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)\
**Post date:** [February 1, 2022, 2:17am UTC](https://meta.discourse.org/t/change-the-default-group-pages-to-messages/212123/12 "2022-02-01T02:17:02Z")

</div>

I’ve got one more thing that I need a hand with in order to fully complete this. It is a bit cheeky to ask, I know.

I’m now trying to modify the [Pavilion](https://thepavilion.io/t/groups-widget/4881) so that it can support this behaviour too, using the simple logic from your three awesome snippets. However, I just can’t get it to work due to my ineptitude with javascript. This is what I’m trying to modify:

```plaintext
createWidget('layouts-group-link', {
  tagName: 'li.layouts-group-link',
  buildKey: (attrs) => `layouts-group-link-${attrs.id}`,

  getGroupTitle(group) {
    return h('span.group-title', group.name);
  },

  isOwner(group) {
    if (group.owner) {
      return h('span.group-owner-icon', iconNode('shield-alt'));
    }
  },

  html(attrs) {
    const contents = [this.getGroupTitle(attrs), this.isOwner(attrs)];
    return contents;
  },

  click() {
      DiscourseURL.routeTo(`/g/${this.attrs.name}/messages`);
  },
});

```

How do I apply the bit below to that? I’ve tried everything that I could think of to the last `click(){etc}` bit but have failed. I just end up breaking the link completely.

```plaintext
      if (group.is_group_user && group.has_messages) {
        groupURL = `${groupURL}/messages/`;
      }

```

---

_[View the full topic](https://meta.discourse.org/t/change-the-default-group-pages-to-messages/212123)._
