Skip to main content
Solved

Subscribe button on custom pages

  • July 24, 2024
  • 6 replies
  • 69 views

alan.edwards
Forum|alt.badge.img+1

Is there any possibility of adding a subscribe button (of a category) on to a custom page that has the content on a dynamic content widget?

 

Trying to reduce click as i want users to see my custom page and have the ability to subscribe to see new content without the need to visit the underlining content page.

 

Any thoughts would be greatly appreciated.

Best answer by jvdc

Actually, I managed to create a button on custom page to subscribe users to a specific category.

Add an HTML widget and add the following piece of code in it:

<div data-view="Tooltip" class="tooltip tooltip--day forum-subscribe-button" data-mn="ItemView" data-mn-app="frontend">

  <button class="btn--toggle qa-forum-subscribe-button js-tooltip-trigger tooltip-trigger js-tooltip-trigger"

          data-component="subscribe"

          data-data='{

            "isGuest": 0,

            "url": "/subscribers/subforum/3",

            "strings": {

              "subscribed": "Unsubscribe",

              "unsubscribed": "Subscribe"

            }

          }'

          aria-haspopup="true">

    <span class="text">Subscribe</span>

    <span class="loader"></span>

  </button>

  <div class="tooltip__content tooltip__content--subscribe js-tooltip-content position--bottom">

    <i class="arrow"></i>

    When you subscribe we will email you when there is a new topic in this category

  </div>

</div>

 

  • Replace 3 with your actual category ID.

  • Example: /subscribers/subforum/7 for Category ID 7.

6 replies

Forum|alt.badge.img+3
  • Helper ⭐️⭐️
  • July 24, 2024

I don’t have a solution here, but commenting to join the thread and say I would also find this super valuable!


revote
Forum|alt.badge.img+2
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • July 25, 2024

Is there any possibility of adding a subscribe button (of a category) on to a custom page that has the content on a dynamic content widget?

I think your DCW displays content from several categories? If yes then I think I can see your point. Not all of the categories?

But, how these notifications should work? It would point to the content, not to the custom page?

My opinion, the best solution would be the option to select what categories user wants to subscribe, at one place. Example:

List of categories and every category has checkbox next to, if user wants to subscribe it.


Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • July 31, 2024

Hi @alan.edwards - I’ve been doing a bit of research on this one.  It is technically possible to recreate a ‘subscribe’ button (for a community category) on a custom page but it’s not that straightforward.  If you have some development skills or a friendly developer that can help, it can be done.  While I’m not able to explain all the details (it’s too technical for me), I can give you a couple of small pointers:

  • The link for subscribing to a category looks like this: /subscribers/subforum/{categoryId}
  • You’d need to include the CSRF token in the post request (you can find that as a hidden field on the category page)

 


alan.edwards
Forum|alt.badge.img+1
  • Author
  • Contributor ⭐️⭐️⭐️
  • July 31, 2024

Thank you, i will have a play and let you know how i get on.


jvdc
  • Helper ⭐️⭐️⭐️
  • July 24, 2025

Hey I am interested in doing this too, but I am missing some information.

Basically we've “re-created” a community landing page displaying content from a community category, and I would like to display a button for users to subscribe to the community category.

Has anyone been able to do this?


jvdc
  • Helper ⭐️⭐️⭐️
  • Answer
  • July 24, 2025

Actually, I managed to create a button on custom page to subscribe users to a specific category.

Add an HTML widget and add the following piece of code in it:

<div data-view="Tooltip" class="tooltip tooltip--day forum-subscribe-button" data-mn="ItemView" data-mn-app="frontend">

  <button class="btn--toggle qa-forum-subscribe-button js-tooltip-trigger tooltip-trigger js-tooltip-trigger"

          data-component="subscribe"

          data-data='{

            "isGuest": 0,

            "url": "/subscribers/subforum/3",

            "strings": {

              "subscribed": "Unsubscribe",

              "unsubscribed": "Subscribe"

            }

          }'

          aria-haspopup="true">

    <span class="text">Subscribe</span>

    <span class="loader"></span>

  </button>

  <div class="tooltip__content tooltip__content--subscribe js-tooltip-content position--bottom">

    <i class="arrow"></i>

    When you subscribe we will email you when there is a new topic in this category

  </div>

</div>

 

  • Replace 3 with your actual category ID.

  • Example: /subscribers/subforum/7 for Category ID 7.