CLOUD PAGE ENABLEMENT - PART 3

 CLOUD PAGE ENABLEMENT - PART 3


USE CASE :

Create a cloud page to collect consent from subscribers. 

1. Leverage content blocks to call AMPScript blocks and HTML blocks
2. Build custom CSS using code resource and leverage it in your cloud pages

In our part 1 and part 2 of this series we have learnt how to built cloud page(s) with form controls using HTML content block, and, AMPScript block to Upsert data into data extension using code snippet.

If you want to recap , here are the links 

In Part 3 of this series we will learn how to add custom css leveraging code resource and how to use them in our Consent Landing page.

Step 1. Create a CSS code resource



Click Next



Step 2. Add Custom CSS and publish the page :


<style class="main_style">p {
    display: block;
}

body {
    color: #000;
    font-family: Arial !important;
    font-size: 12px;
    margin: 0 auto !important;
    max-width: 1280px;
    padding: 5px !important;
    background-color: #e7e9eb !important;
}

.fw-bold {
    font-weight: 700 !important;
}

div {
    display: block;
}

@media screen and (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

@media screen and (max-width: 992px) {
    .container {
        max-width: 100%;
    }
}

@media screen and (max-width: 769px) {
    .container {
        max-width: 100%;
    }

    .mobile-hidden {
        display: none !important;
    }

    .responsive-td {
        width: 100% !important;
        display: block !important;
        padding: 0 !important;
    }
}

</style>

Step 3. Go to you landing page and include CSS link to your landing pages

Copy the URL of your CSS code resource and update the "href" attribute value 

<link rel="stylesheet" href="https://tenantEndPoint/ConsentStyles">

For bootstrap CSS , add the below CSS as well
 <link rel="stylesheet" href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.css"> 

I would also suggest you to add meta tag to your html 
   <meta name="viewport" content=
   "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Let's see how our landing page looks like :

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width,
    initial-scale=1, maximum-scale=1, user-scalable=0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href=
        "https://TenantEndPoint/ConsentStyles">
    <link rel="stylesheet" href=
    "https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href=
    "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.css">
    <script runat="server">
      Platform.Load("Core","1.1.1");
      try{
    </script>
    %%=ContentBlockbyKEY("ConsentBlock")=%%
    <script runat="server">
      }
      catch(e){
        Variable.SetValue("@message1",e.message);
      }
    </script>
  </head>
  <body>
    <div class="p-3 mb-2 bg-secondary text-white">
      <div class="section">
        <div class="columns col1">
          <div data-type="slot" data-key="col1">
            <div class="alert alert-warning alert-dismissible fade show"
             role="alert"  %%=v(@hidden)=%%>
              <strong>%%=v(@message1)=%%</strong>%%=v(@message2)=%%
              <button type="button" class="close" data-dismiss="alert"
aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            %%=ContentBlockbyKEY("ConsentForm")=%%
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

Comments


Knowledge Article

Most Viewed

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Journey Builder REST API Documentation

Preference Center Demystified

Popular Posts

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Journey Builder REST API Documentation

Preference Center Demystified

SEND LOG EANBLEMENT

Share with Friends

Disclaimer:

The information provided on this technical blog is for general informational purposes only. As a SFMC (Salesforce Marketing Cloud) Technical Architect, I strive to offer accurate and up-to-date content related to SFMC and its associated technologies. However, please note that technology is constantly evolving, and the information provided may become outdated or inaccurate over time.

The content published on this blog represents my personal views and experiences as a SFMC Technical Architect and does not necessarily reflect the official views or opinions of any organization or employer I may be affiliated with.

While I make every effort to ensure the accuracy and reliability of the information presented, I cannot guarantee its completeness, suitability, or applicability to your specific circumstances. Therefore, it is essential to verify any information provided and make your own independent assessments or seek professional advice if needed.

Furthermore, any actions taken based on the information provided on this blog are at your own risk. I shall not be held liable for any damages, losses, or inconveniences arising from the use of the information presented here.

Please keep in mind that SFMC and its associated technologies are complex and require technical expertise for proper implementation and management. It is recommended to consult with qualified professionals or official SFMC documentation for comprehensive guidance.

Finally, please note that any product or company names mentioned on this blog are trademarks or registered trademarks of their respective owners. The mention of these trademarks or registered trademarks does not imply any endorsement or affiliation with the blog.

By accessing and using this blog, you agree to the terms of this disclaimer. If you do not agree with any part of this disclaimer, please refrain from using this blog.