{"id":45779295,"url":"https://github.com/plesk/ext-home-screen-example","last_synced_at":"2026-02-26T10:58:20.702Z","repository":{"id":271389228,"uuid":"912747959","full_name":"plesk/ext-home-screen-example","owner":"plesk","description":"Custom Dashboard Extension Example","archived":false,"fork":false,"pushed_at":"2025-02-11T12:23:04.000Z","size":71,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-02-11T13:30:59.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-06T10:08:32.000Z","updated_at":"2025-02-11T12:23:07.000Z","dependencies_parsed_at":"2025-01-07T12:34:19.753Z","dependency_job_id":"27b66547-2465-472c-be84-561e17013402","html_url":"https://github.com/plesk/ext-home-screen-example","commit_stats":null,"previous_names":["plesk/ext-home-screen-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/plesk/ext-home-screen-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plesk%2Fext-home-screen-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plesk%2Fext-home-screen-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plesk%2Fext-home-screen-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plesk%2Fext-home-screen-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plesk","download_url":"https://codeload.github.com/plesk/ext-home-screen-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plesk%2Fext-home-screen-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29856783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T08:51:08.701Z","status":"ssl_error","status_checked_at":"2026-02-26T08:50:19.607Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-26T10:58:19.963Z","updated_at":"2026-02-26T10:58:20.689Z","avatar_url":"https://github.com/plesk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Dashboard Extension Example\n\nThis README explains how you can customize your extension's block on the administrator's Home page via a number of methods provided by the abstract `Block` class.\n\n## Setup\n\n```sh\ngit clone https://github.com/plesk/ext-home-screen-example\ncd ext-home-screen-example/\ncomposer install\n```\n\n## Packaging \u0026 Installation\n\n```sh\ncd ..\nzip -r ext-home-screen-example.zip ext-home-screen-example/ --exclude \"ext-home-screen-example/.git/*\"\nplesk bin extension -i ext-home-screen-example.zip\n```\n\n## Customization Options\n\n### 1. Block ID `getId()`\n\nDefines the block's unique identifier.\n\n**Example:**\n\n```php\npublic function getId(): string {\n    return 'example_block';\n}\n```\n\n### 2. Block Title `getTitle()`\n\nDefines the block's name (by default, it is the same as the extension's name). The name will be shown when customizing the Home page (inside the Customize drawer). It's always loaded synchronously and should be lightweight.\n\n**Important:** The name is unescaped HTML. Make sure it's properly sanitized.\n\n**Example:**\n\n```php\npublic function getTitle(): string {\n    return \"Custom Dashboard Block\";\n}\n```\n\n![img.png](images/img_4.png)\n\n### 3. Block Content `getContent()`\n\nDefines the block's content that will be shown inside the block on the Home page.\n\n**Important:** The content is unescaped HTML. Make sure that any dynamic data is properly escaped and sanitized to prevent security issues.\n\n**Example:**\n\n```php\npublic function getContent(): string {\n    return \"\u003cdiv\u003eCustom dashboard block content example\u003c/div\u003e\";\n}\n```\n\n![img_1.png](images/img_5.png)\n\n### 4. Block Footer `getFooter()`\n\nDefines the content of the block's footer (by default, it's empty).\n\n**Important:** The footer is unescaped HTML. Make sure that any dynamic data is properly escaped and sanitized to prevent security issues.\n\n**Example:**\n\n```php\npublic function getFooter(): string {\n    return \"\n        \u003cdiv class='footer-links'\u003e\n            \u003ca href='/docs'\u003eDocumentation\u003c/a\u003e | \n            \u003ca href='/support'\u003eSupport\u003c/a\u003e\n        \u003c/div\u003e\n    \";\n}\n```\n\n![img_2.png](images/img_6.png)\n\n### 5. Block Column `getColumn()`\n\nDefines which of the three columns on the Home page the block will be placed in.\n\n- **0**: First column\n- **1**: Second column\n- **2**: Third column (the last column by default)\n\nBy default, the block will be placed in the last column (column `2`).\n\n**Example:**\n\n```php\npublic function getColumn(): int {\n    return 1;\n}\n```\n\n### 6. Block Order `getOrder()`\n\nDefines the order in which the block will appear within the column it's placed in. The blocks are ordered depending on their respective `getOrder()` values. By default, the block will be placed last within its column.\n\nYou can customize this order by returning a specific integer value. The lower the value, the higher the block will be placed within its column, and vice versa.\n\n**Example:**\n\n```php\npublic function getOrder(): int {\n    return 1;\n}\n```\n\n### 7. Asynchronous Loading `isAsyncLoaded()`\n\nDefines whether the content of the block may be loaded asynchronously (true by default). Asynchronous loading improves the Home page load time by allowing the block's content to be fetched in the background while the rest of the page is being rendered.\n\n- **Synchronous Blocks** content is loaded during page preload (before rendering) to avoid the blinking caused by switching from a skeleton to the block's content. This blocks the page rendering, and should only be used for blocks that load very quickly.\n\n- **Asynchronous Blocks** content is loaded after the page has been rendered. This doesn't block the page rendering. A skeleton is shown as a placeholder while the content is being loaded.\nIf the content loads very quickly, the transition from the skeleton to the block's content may cause blinking. In such cases, a synchronous block may be preferable.\n\n- **Default behavior**: The block content is loaded asynchronously (true by default).\n\n**Example:**\n\n```php\npublic function isAsyncLoaded(): bool {\n    return false;\n}\n```\n\n### 8. Skeleton Size `getSkeletonSize()`\n\nDefines the size of the skeleton (content placeholder) to be shown while the block’s content is being loaded. This option is only applicable when the block is set to load asynchronously. By default, the size of the skeleton is set to 2.\n\n**Example:**\n\n```php\npublic function getSkeletonSize(): int {\n    return 10;\n}\n```\n\n![img_3.png](images/img_7.png)\n\n### 9. Block Enabled `isEnabled()`\n\nDefines whether the block is to be shown on the Home page (true by default). Disabled blocks do not appear on the Home page.\n\n- **Default behavior**: The block is enabled by default.\n\n**Example:**\n\n```php\npublic function isEnabled(): bool {\n    return false;\n}\n```\n\n![img.png](images/img.png)\n\n### 10. Block Section `getSection()`\n\nDefines the section the block belongs to, which determines where it will appear when customizing the Home page (inside the Customize drawer). You can place the block in one of the following sections:\n\n- `SECTION_PLESK` – Default section for blocks (all blocks are placed in this section unless a different section is explicitly specified)\n- `SECTION_SERVER` – For server-related blocks\n- `SECTION_SECURITY` – For security-related blocks\n\n**Example:**\n\n```php\npublic function getSection(): string {\n    return self::SECTION_SERVER;\n}\n```\n\n![img_4.png](images/img_8.png)\n\n### 11. Block Section Order `getSectionOrder()`\n\nDefines the position of the block relative to other blocks in the same section when customizing the Home page (inside the Customize drawer). By default, the block is placed last.\n\nYou can control the sequence in which blocks appear within their respective section by returning a specific integer value. Blocks with a lower order value will be placed before those with a higher value.\n\n**Example:**\n\n```php\npublic function getSectionOrder(): int {\n    return 1;\n}\n```\n\n### 12. Block Name `getName()`\n\nDefines the block's name shown when customizing the Home page (inside the Customize drawer). By default, it is the same as the extension's name.\n\n**Example:**\n\n```php\npublic function getName(): string {\n    return 'Custom Dashboard Block'; \n}\n```\n\n![img_1.png](images/img_3.png)\n\n### 13. Block Icon `getIcon()`\n\nSpecifies the icon to be shown alongside the block name when customizing the Home page.\n\n**Example:**\n\n```php\npublic function getIcon(): string {\n    return 'mail';\n}\n```\n\n![img.png](images/img_2.png)\n\n### Declaring Multiple Dashboard Blocks\n\nExtensions can expose multiple custom blocks that are declared via the `Plesk\\SDK\\Hook\\Home` hook.\n\n```php\nnamespace Plesk\\SDK\\Hook;\n\n/**\n * Hook for embedding custom blocks into the Home page in SPV.\n *\n * @since 18.0.60\n */\nuse Plesk\\SDK\\Hook\\Home;\nuse PleskExt\\Example;\n\nreturn new class () extends Home {\n    /**\n     * Retrieve blocks for the Home page in SPV.\n     *\n     * @return Home\\Block[]\n     */\n    public function getBlocks(): array\n    {\n        return [\n            new Example\\HomeSyncBlock(),\n            new Example\\HomeAsyncBlock(),\n        ];\n    }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplesk%2Fext-home-screen-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplesk%2Fext-home-screen-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplesk%2Fext-home-screen-example/lists"}