---
title: Device macros
related:
  - https://docs.kentico.com/k11/developing-websites/developing-websites-for-mobile-devices/creating-device-profiles.md
  - https://docs.kentico.com/k11/macro-expressions.md
  - https://docs.kentico.com/k11/developing-websites/developing-websites-for-mobile-devices/configuring-51degrees-device-detection.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

## CurrentDevice

The _CurrentDevice_ object holds information about the device detected for the current visitor. The system identifies devices based on their user-agent and retrieves the data about the capabilities of devices using the _HttpBrowserCapabilities_ class of the .NET Framework.

> **Tip:** **51Degrees device detection**
>
> The default device recognition of the .NET Framework might not be sufficiently accurate for your needs. If you want to implement device profiles effectively, we recommend utilizing the [51Degrees device detection](https://docs.kentico.com/k11/developing-websites/developing-websites-for-mobile-devices/configuring-51degrees-device-detection.md).

You can take advantage of the _CurrentDevice_ object when defining conditions for device profiles and in general [macro expressions](https://docs.kentico.com/k11/macro-expressions.md). To view a full list of the device properties that are available by default, see the [HttpBrowserCapabilities Properties](https://msdn.microsoft.com/en-us/library/system.web.httpbrowsercapabilities_properties\(v=vs.110\).aspx) article on the Microsoft Developer Network.

The properties are accessible through the _Data_ container and indexing. For example:

- _{% CurrentDevice.Data\["JavaScript"] %}_
- _{% CurrentDevice.Data\["IsMobileDevice"] %}_

## CurrentDeviceProfile

To get information about the device profile assigned to the current visitor's device, use the _CurrentDeviceProfile_ object in macros:

- You can access the device profile's system data through its properties, for example: _{% CurrentDeviceProfile.ProfilePreviewWidth %}_
- To directly get the device profile's name, use the following expression: _{% CurrentDeviceProfileName %}_
