$PAGE

Overview

The page object is accessed using the $PAGE variable. This object contains information pertaining to the current network level page or user or group page.

Common Uses

Here are some common ways the $PAGE object is used.

Logged In State

Show a Warning

The ‘alert’ method allows you to show a note in the common DIV at the top of the page.

Attributes

Variable Description
NODE_ID The numeric id for the current node of the social network
NETWORK_ID The numeric id for the current network of the social network
BLOG_ID The numeric id for the current user/group site on the network
UID The numeric id for the logged in user, or 0 for logged out users
ORIGIN_URL The requested URL (i.e. www.domain.com/user/blog?value=1)
CURRENT_DOMAIN_FULL www.domain.com
CURRENT_DOMAIN domain.com
CURRENT_SITE domain.com/subdirectory
CURRENT_SITE_URL www.domain.com/subdirectory
CURRENT_REQUEST_URI http(s)://www.site.com/go/page/current
NODE_HOME domain.com
NODE_NAME The name of the current node
NETWORK_NAME The name of the current network
BLOG_OWNER The numeric id for the user who owns the current site
SUBDIR subdirectory
TIERS The numeric id (or CSV string) of the tiers the current site is in
IS_HTTPS Is the page loading on a secure connection.
SESSION_ID The unique session identifier for the page viewer
IS_FRIEND 1 if the page viewer is friends with the page owner, 0 if otherwise
IS_GROUP 1 if the page is a group, 0 if otherwise
USER_RELATION owner, moderator, group_member, friend, member, or non_member
CLIENT_VERSION The version id of the site itself (used for breaking the CDN cache of all user facing resources such as CSS, Javascript and images)
CURRENT_VERSION The version id of all static resources (used for breaking CDN cache)
LANG The language of the currently browsing user

Page Control Methods

Adjusting Meta Information

Important: If you put in the values directly, you must wrap them in quotes.

Page Code

Note: you cannot use a variable to define the page code name.