Add a Favorites button so users can save items

Goal

Give your app a Favorites screen — a single place where each signed-in user sees the items they have saved — and turn on the favorite (“check-in”) control on listing detail screens so users can save items while they browse.

Favorites in MAM Suite is a two-part feature:

  • The Favorites button — a content type you add just like any other button — renders that saved-items list.
  • The favorite/check-in widget on a listing detail screen is what users actually tap to add or remove an item. Skip this part and the Favorites list has nothing to show — there’s no other way for it to fill up.

This recipe covers both pieces, along with the global flags that tie them together.


Prerequisites

  • Admin access to Mobile App Manager.
  • mam-main active. The Favorites content type ships with mam-main.
  • At least one source plugin that owns the items being favorited. mam-main provides the list view and the toggle event, but it does not own a favorites store of its own — a sibling plugin persists each saved item. mam-geodirectory is the common source: it persists favorites in gd_user_favourite_post user meta and contributes the on-listing favorite/check-in widget. If you are only running mam-main with no source plugin, the Favorites screen will render but stay empty.
  • A content type whose detail screens should offer favoriting (for example, GeoDirectory listings).

Worth knowing up front: your source plugins decide which item types can be favorited, not the Favorites button — the button only renders what’s already there.


Steps

1. Add the Favorites button

  1. Go to Mobile App Manager → Buttons.
  2. Click Add a Button.
  3. Choose the Favorites content type from the dropdown and give it a display title (for example, “Favorites” or “Saved”).

The Favorites content type has no content-source settings of its own — you’ll see its content-source form simply read “No settings required”. That’s because it pulls its data straight from the saved items your source plugins already store, so there’s nothing here for you to point it at.

That’s it — the button is now saved to the active role’s button array, and you’ll see it appear in the Buttons list.

2. Set the empty-state message and global flags

Open the Favorites button’s detail page. Alongside the usual per-button style settings (colors, icon), you’ll find the global Favorites settings — these control how the list itself behaves:

Setting What it does
Empty-state text The message shown when the user has saved nothing yet (for example, “You haven’t saved anything yet”).
Report favorites When on, the app sends a favorite-toggle event to the server each time the user taps the favorite control. Leave this on so that saves persist on the server and survive reinstalls and multi-device use.
Hide “remove all” When on, hides the “remove all favorites” link in the list UI.

The labels you see in the admin may differ slightly from the names above — under the hood these are the report_favorites and hide_remove_all_favorites flags, and both get mirrored into the app’s payload (the bundle of data the app downloads from your site). Turn Report favorites off, and the app never tells the server about a save — which means the Favorites list can’t be rebuilt if the user switches devices.

Favorites only makes sense once someone’s signed in, so this is usually a per-role button. Use the role dropdown at the top of the Buttons page and add the Favorites button only for the roles that should see it. That separation holds all the way through — a role you never add the button to simply never receives it when the app fetches its data.

4. Place the Favorites button on a screen

Adding the button isn’t enough on its own — it won’t show up until you place it somewhere. Put it wherever users will naturally look for their saved items:

  • Tab bar: Mobile App Manager → Navigation → Tab Bar — choose Favorites as one of the (up to 5) tabs. This is the most common placement.
  • Left menu: Mobile App Manager → Navigation → Left Menu — drag Favorites into the menu.
  • Home screen: Mobile App Manager → Layout — drag the button into a layout section.

5. Turn on the on-listing favorite (check-in) control

This is the part users actually tap to save something. For GeoDirectory listings, that’s the check-in / favorite content section on the listing detail screen.

  1. Go to App Settings → Layouts → {your content type} → Detail.
  2. Make sure the favorite/check-in section is enabled in the detail layout. (For GeoDirectory this is the section internally named check_in_fav, sometimes shown with a label like “On Screen Favorite.”)
  3. Optionally reorder it — by default it renders near the top of the detail screen — and set a custom display title.

A couple of things worth knowing before you test:

  • The favorite/check-in widget is hidden for owners, managers, and staff of a listing — those users see their management controls in its place instead, so the favorite control would only get in the way. Test with a regular member account, not an admin or listing owner.
  • Each tap is immediate — there’s no “pending” or “undo” state to wait through. When Report favorites is on, the tap fires a server event right away, and the saved item lands in the source plugin’s user meta (for GeoDirectory, gd_user_favourite_post).

6. Verify in the Previewer

  1. Open the Previewer and switch to a non-owner member role.
  2. Open a listing detail screen and tap the favorite/check-in control. It should toggle on.
  3. Open the Favorites screen. The item you just saved should appear.
  4. Tap the control again to unfavorite, return to Favorites, and confirm the item is gone.
  5. Save nothing and confirm the empty-state message reads as you configured it.

If you favorite something and the Favorites list still comes up empty, work through this list:

  • Confirm Report favorites is on — if it is off, the toggle never reaches the server and nothing is stored.
  • Confirm a source plugin owns the item type. mam-main alone has no favorites store.
  • Confirm you are testing as a regular member, not an owner/manager/staff member (the favorite control is hidden for them).
  • Confirm the favorite/check-in section is enabled in the detail layout for that content type.

How it fits together

Piece Owned by Role
Favorites button / list view mam-main (Favorites content type) Renders the saved-items screen.
Favorite / check-in widget Source plugin (for example, mam-geodirectory’s check_in_fav detail section) The control users tap to save an item.
Saved-items store Source plugin user meta (for example, gd_user_favourite_post) Persists each user’s saved items.
Toggle event mam_manage_favorites action (mam-geodirectory also fires mam_gd_manage_favorites) Lets the server record the save when Report favorites is on.

If you (or your developer) want to extend this — persisting favorites for a custom post type, or running side effects like analytics or recommendations when someone saves an item — the hook references below are the place to start.


  • Recipe: Add a button — the general button-placement workflow this recipe builds on.
  • Content class: Favorites — the reference for the Favorites content type, its settings, and its JSON shape.
  • Hook: mam_manage_favorites — for persisting favorites from your own sibling plugin.
  • Hook: mam_gd_manage_favorites — GeoDirectory’s post-toggle action, for side effects after a save.
  • Listing detail content sections — where the GeoDirectory check-in/favorite section is configured.
Was this article helpful?
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!