{"id":25519715,"url":"https://github.com/aligent/aligent_sociallinks_m2","last_synced_at":"2025-12-22T10:30:13.949Z","repository":{"id":22831038,"uuid":"97425590","full_name":"aligent/Aligent_SocialLinks_M2","owner":"aligent","description":"Magento 2 module to specify links to the social accounts for a particular website.","archived":false,"fork":false,"pushed_at":"2022-05-16T23:34:12.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":36,"default_branch":"main","last_synced_at":"2025-02-16T13:23:55.160Z","etag":null,"topics":["magento2","social-media","widget"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aligent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2017-07-17T02:08:46.000Z","updated_at":"2022-02-09T22:19:00.000Z","dependencies_parsed_at":"2022-07-25T19:17:56.458Z","dependency_job_id":null,"html_url":"https://github.com/aligent/Aligent_SocialLinks_M2","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2FAligent_SocialLinks_M2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2FAligent_SocialLinks_M2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2FAligent_SocialLinks_M2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligent%2FAligent_SocialLinks_M2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aligent","download_url":"https://codeload.github.com/aligent/Aligent_SocialLinks_M2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239703300,"owners_count":19683242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["magento2","social-media","widget"],"created_at":"2025-02-19T17:29:29.601Z","updated_at":"2025-12-22T10:30:13.335Z","avatar_url":"https://github.com/aligent.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aligent SocialLinks Magento 2 Module\n\nThis module will allow you to specify links to the social accounts for a particular website.\n\n## Installing\n\nEnsure the repository `https://github.com/aligent/Aligent_SocialLinks_M2.git` is listed under the repositories section in your `composer.json` file, e.g.\n\n```\n\"repositories\": [\n    {\n        \"type\": \"vcs\",\n        \"url\": \"https://github.com/aligent/Aligent_SocialLinks_M2.git\"\n    }\n]\n```\n\nThen run\n\n`composer require aligent/sociallinks`\n\nIf the latest release isn't included, you may need to edit the `composer.json` file manually, changing the entry to `\"aligent/sociallinks\": \"dev-master\"`, and then running `composer update aligent/sociallinks`\n\n## Enable the module\n\n`bin/magento module:enable Aligent_SocialLinks`\n\nAn instance of the Widget will be automatically created and assigned to the currently active theme.\n\n## Create Instance of Widget through Upgrade script\n\nThe following file contents shows the minimum requirements of the upgrade script to create an instance of the SocialLinks widget and save it to the database\n\n```php\n\u003c?php\nnamespace Aligent\\CMS\\Setup;\n\nuse Magento\\Widget\\Model\\Widget\\InstanceFactory as WidgetFactory;\n\nclass CmsSetup {\n    /**\n     * @var WidgetFactory\n     */\n    protected $widgetFactory;\n    \n    /**\n     * Init\n     *\n     * @param WidgetFactory $widgetFactory\n     */\n    public function __construct(\n        WidgetFactory $widgetFactory\n    ) {\n        $this-\u003ewidgetFactory = $widgetFactory;\n    }\n    \n    /**\n     * {@inheritdoc}\n     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)\n     */\n    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {\n        if (version_compare($context-\u003egetVersion(), '1.0.0', '\u003c')) {\n            $widgetData = [\n                'instance_type' =\u003e 'Aligent\\\\SocialLinks\\\\Block\\\\SocialLinks',\n                'title' =\u003e 'Aligent Social Links'\n            ];\n\n            // Update the usernames for each of the required social networks\n            // If a network isn't required, it can be removed from the array\n            $widgetParams = [\n                'display_text' =\u003e 'network_name',\n                'twitter' =\u003e 'aligent',\n                'facebook' =\u003e 'aligent',\n                'instagram' =\u003e 'aligent',\n                'youtube' =\u003e 'aligent',\n                'snapchat' =\u003e 'aligent',\n                'pinterest' =\u003e 'aligent',\n                'tiktok'    =\u003e 'aligent',\n                'linkedin'  =\u003e 'aligent'\n            ];\n\n            $widget = $this-\u003ewidgetFactory-\u003ecreate();\n            $widget-\u003eaddData($widgetData);\n            $widget-\u003esetWidgetParameters($widgetParams);\n            $widget-\u003esetPageGroups(null);\n            $widget-\u003esave();\n        }\n    }\n}\n```\n\n## Adding module to page\n\nThe module will then need to be added to a page/s using XML. The following line, place inside a `referenceContainer` will\nachieve this\n\n`\u003cblock class=\"Aligent\\SocialLinks\\Block\\SocialLinks\" name=\"aligent.social.links\" as=\"aligentSocialLinks\"/\u003e`\n\n## Styling the links\n\nThe links aren't styled at all, and will just display the name of the social network inside an \u003ca\u003e tag. This makes it\nvery straightforward for you to use any styling you would like, along with any icons.\n\nThe links are contained in the following HTML structure\n\n```\n\u003cdiv class=\"aligent-social-links-container\"\u003e\n    \u003cdiv class=\"aligent-social-links-inner-container\"\u003e\n        \u003cul class=\"aligent-social-links\"\u003e\n            \u003cli\u003e\n                \u003ca class=\"aligent-social__link social__link--facebook\" href=\"http://www.facebook.com/username\"\u003e\n                    \u003cspan class=\"aligent-social__text\"\u003eFacebook\u003c/span\u003e\n                \u003c/a\u003e\n            \u003c/li\u003e\n        \u003c/ul\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\n\n## Using your own custom template\n\nIf you would like to overwrite the default template, and display the links in another way, you can do that very easily.\n\nCreate a new `social-links.phtml` file in your theme's folder inside `design`, E.g.\n`app/design/frontend/Magento/{your_theme_name}/Aligent_SocialLinks/templates/social-links.phtml`\n\nInside the template `$block` will be an instance of `Aligent\\SocialLinks\\Block\\SocialLinks`, and you simply call\n`$block-\u003egetUrls()` to get the URLs set in the database\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligent%2Faligent_sociallinks_m2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faligent%2Faligent_sociallinks_m2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligent%2Faligent_sociallinks_m2/lists"}