Customizing the favicon and metadata in Power Pages is essential for ensuring your portal has a unique identity and proper visibility in search engines. This process involves updating the favicon (the small icon displayed in the browser tab) and modifying the metadata (such as title, description, and keywords) for SEO purposes.
Here’s a detailed guide on how to customize these elements:
1. Customizing the Favicon
Step 1: Prepare Your Favicon File
- A favicon is typically a square image of size 16x16px, 32x32px, or 48x48px. For better scaling, it’s often recommended to use a .ico format, but .png and .jpg are also supported.
- Ensure the image is simple and represents your brand (e.g., logo, initials).
Step 2: Upload the Favicon to Power Pages
- Go to Power Apps > Portal Management.
- Navigate to Web Files > + New to upload your favicon.ico or favicon.png file.
- Set the Name to something relevant, such as
favicon.ico
orsite-favicon.png
. - Provide a Partial URL (e.g.,
/images/favicon.ico
). - Set the MIME Type to
image/x-icon
for.ico
files orimage/png
for.png
files. - Save the Web File.
Step 3: Add Favicon Reference to Web Template
- Navigate to your Web Template.
- In the
<head>
section of the template, add the following code to reference the favicon:
<link rel="icon" href="/images/favicon.ico" type="image/x-icon">
- If you are using a
.png
file, update thehref
and MIME type accordingly:
<link rel="icon" href="/images/favicon.png" type="image/png">
- Save the Web Template.
2. Customizing Metadata for SEO
Step 1: Add Title and Description in Web Template
Metadata helps search engines index your portal pages better. Customizing your title and description can improve SEO and user experience.
- Go to the Web Template you want to customize.
- In the
<head>
section, add the following meta tags for title, description, and keywords:
<title>Your Portal Title</title>
<meta name="description" content="This is the description of your portal.">
<meta name="keywords" content="portal, your brand, services, features">
- Title: Appears in search engine results and browser tabs.
- Description: Provides a summary of your portal for search engines and social sharing.
- Keywords: A set of relevant keywords for better search engine indexing (though their importance has diminished over time).
Step 2: Add Open Graph Tags for Social Media
Open Graph meta tags are used by social media platforms like Facebook, Twitter, and LinkedIn to display rich preview cards when your portal link is shared. Here’s how to add them:
<meta property="og:title" content="Your Portal Title">
<meta property="og:description" content="A brief description of your portal.">
<meta property="og:image" content="https://yourportal.com/path-to-image.jpg">
<meta property="og:url" content="https://yourportal.com">
<meta property="og:type" content="website">
- og:title: The title to show when shared on social media.
- og:description: A short description for the shared link.
- og:image: A URL to an image that will be used as a thumbnail.
- og:url: The URL of the page being shared.
- og:type: The type of content (e.g., “website”).
Step 3: Add Twitter Cards for Rich Previews on Twitter
Twitter Cards allow your portal to display a rich preview when shared on Twitter. Add the following tags to the <head>
section:
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Your Portal Title">
<meta name="twitter:description" content="A brief description of your portal.">
<meta name="twitter:image" content="https://yourportal.com/path-to-image.jpg">
- twitter:card: Specifies the type of card (use
summary_large_image
for a large preview). - twitter:title: The title for Twitter.
- twitter:description: The description for Twitter.
- twitter:image: URL to an image to use as a thumbnail for Twitter.
3. Adding Custom Meta Tags for Specific Pages
If you need to set different metadata for individual pages (e.g., the homepage vs a contact page), you can achieve this using Liquid templates.
Step 1: Modify the Web Template
Inside your Web Template, use Liquid code to dynamically populate metadata based on the page content:
<title>{{ page.title }}</title>
<meta name="description" content="{{ page.meta_description }}">
<meta name="keywords" content="{{ page.meta_keywords }}">
- page.title: Fetches the page title dynamically.
- page.meta_description: Fetches the meta description for the page.
- page.meta_keywords: Fetches the keywords for the page.
Step 2: Set Meta Data for Individual Pages
When creating or editing a page, add custom metadata fields:
- Open your page.
- In the Metadata section, set the
Title
,Description
, andKeywords
. - Save the changes.
4. Additional Customizations and Best Practices
- Use Structured Data: For better SEO, consider adding schema.org structured data to describe your portal’s content. This can enhance visibility in search results (rich snippets).
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "Your Portal Name",
"url": "https://yourportal.com"
}
</script>
- Accessibility Considerations: Ensure that the title and description provide clear context, and avoid using vague or overly broad terms.
5. Testing and Troubleshooting
- Verify the Favicon: Clear browser cache and refresh the portal to ensure the favicon appears correctly.
- Check Meta Tags: Use online tools like Google Structured Data Testing Tool or Facebook Sharing Debugger to preview how your metadata appears in search engines and social media.
- Mobile Optimization: Ensure your portal’s metadata looks good on both desktop and mobile devices.