---
schema_version: "1"
id: 0656cda6063122ad71b7795b0f2bd092632331b84375953a52b1aba11c536c0d
title: Add Dynamic Branding to Custom Pages
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/external_identity_dynamic_with_custom_login_page.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.external_identity_dynamic_with_custom_login_page.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 1a37819eb7095f8c192ebefcacd6e5c122322c9fd6715aefff0581788e75bb03
description: For custom pages used to log in, verify identity, reset passwords, and self-register, you can implement dynamic URLs with a custom login Apex controller. Use the Apex methods getExperienceId and setExperienceId of the System.Site class to retrieve and store the expid value.
products:
  - Security
  - Cross Cloud
release: "264"
---
# Add Dynamic Branding to Custom Pages

For custom pages used to log in, verify identity, reset passwords, and self-register, you can implement dynamic URLs with a custom login Apex controller. Use the Apex methods `getExperienceId` and `setExperienceId` of the `System.Site` class to retrieve and store the expid value.

The brand that appears at run time depends on the expid dynamic URL that you specify on the Apex page. For example, the dynamic URL, https://www.my-cms.com/{expid}/logo.png, displays the Fix Coffee brand when the login URL is https://fix.my.site.com/?expid=coffee. In this example, the background image of the login page depends on the value of expid.

```java
<apex:page docType=“html-5.0” controller=“CustomLoginController” showHeader=“false” sidebar=“false”
<style>
    body {
        background-image: url(“https://www.my-cms.com/{!ExpID}/promo.jpg}”);
        width: 500px;
        clear: both;
        margin: 40 px 50px;
        vertical-align: middle;
    }
    h2 { color:#5F9EA0; }
</style>
```

In your custom login controller, include code to extract the expid value from the query parameter.

```java
Global CustomLoginController()
{ 
        ...
 Expid = getExpidFromURL();

//Get the expid parameter from query string
Public string getExpidFromURL()
{
    String expid = '';
    expid = ApexPages.currentPage().getParmeters().get('expid');
    Return expid;
}
        ...
}
```

In your custom login controller, also include the `setExperienceId` method of the `System.Site` class to store the expid value in the user’s browser. When stored, you can retrieve it at any time during the lifetime of the user’s session.

```java
Global CustomLoginController()
{ 
        ...
 Expid = getExpidFromURL();
 site.SetExperienceId(expId);
        ...
}
```