About FlagPages

Lets logged-in user flag page content

Category 1Markup Generation
Markup modules that are called upon to generate or parse markup (like HTML). Markup modules are most often used on the front-end of a site (rather than admin).
Category 2Other Modules
Modules that have a unique purpose not covered by existing categories.
Release StateStable
Should be safe for use in production environments. *
Module Version1.0.0
Class NameFlagPages
Date AddedJuly 20, 2014
Last UpdatedMarch 12, 2017
Recommended ByNew recommendations may take up to 1 day to appear.


This module's files should be placed in /site/modules/FlagPages/
How to install or uninstall modules


FlagPages 1.0.0

Module for ProcessWire: lets logged-in users flag pages.

With this module, a logged in user can flag/unflag pages, on whose template the flag link (see below) has been placed. These flags serve as "personal bookmarks" and are not a site-wide sticky setting.

Example Screenshot


On the module's config page you can set the user roles allowed to flag pages.

On the markup side, FlagPages module consists of two parts: Rendering the link and rendering a list with your current bookmarks.

First of all, load the module via:

$flags = $modules->get("FlagPages");

Rendering flag toggle link

Then, use the renderLink method and place the output in your template. By adding the link to all or just certain templates, you can control which templates can be flagged and which can't.

echo $flags->renderLink();

The default output will be "Add {Name} to flags", or "Remove {Name} from flags". You can override these labels with parameters. For example:

echo $flags->renderLink("Add %s to my bookmarks", "Remove %s from my bookmarks");

Rendering the flagged pages list

echo $flags->renderList();

This will output a simple unordered list with links to pages the currently logged-in user has set a flag to.

echo $flags->renderList("classname foo bar");

Optional: If you would like to apply HTML classes on the generated unordered list, supply them as a string to the function's parameter.

Outputting the flagged pages count of the logged in user

echo $flags->showFlagCount();

Returns the count of flagged pages.


  • Requirement: ProcessWire 3.x

Within module area in ProcessWire Backend

Click "New" and search for FlagPages class name.


  1. Download or git clone, rename the module folder to "FlagPages" and put it into your site/modules folder
  2. Go to modules overview page and click "Check for new modules"
  3. Install the module. The module will appear under "Flag" section.

Forum topic




  • Add PHP namespace to ensure compatibility with ProcessWire 3
  • Make classlist argument in renderList() method optional
  • Improve code comments
  • Make error output translatable


  • Fixing module version number to prevent octal interpretation
  • Removing double class based installation method description in readme
  • Fixing method output - returning instead of echo'ing


  • Add method to return flagged pages count
  • Add option to insert HTML class names as renderList's parameter


Using ASM select for chosing user roles with flagging permission


Added setting to limit flagging ability to certain user roles


Simplified renderList() param logic (thanks, teppo)


Add basic functionality


No comments yet. Be the first to post!

Post a Comment

Your e-mail is kept confidential and not included with your comment. Website is optional.