2017 © Pedro Peláez
 

craft-plugin craft3-shortcut

Simple URL shortening

image

superbig/craft3-shortcut

Simple URL shortening

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 3 Versions
  • 19 % Grown

The README.md

Shortcut plugin for Craft CMS

Lets you create short links for elements or arbitrary URLs., (*1)

Installation

You can install Shortcut via the plugin store, or through Composer., (*2)

Craft Plugin Store

To install Shortcut, navigate to the Plugin Store section of your Craft control panel, search for Shortcut, and click the Try button., (*3)

Composer

You can also add the package to your project using Composer., (*4)

  1. Open your terminal and go to your Craft project:, (*5)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*6)

    composer require verbb/shortcut
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Shortcut., (*7)

Usage

To create a short url for a element:, (*8)

{% set shortcut = craft.shortcut.get({ element: entry }) %}

{{ shortcut.getUrl() }}

To create a short url for a url:, (*9)

{% set shortcut = craft.shortcut.get({ url: 'https://cnn.com' }) %}

{{ shortcut.getUrl() }}

By default, short urls is in the format xxxx.tld/s/aBC123. If you want to change the url segment from s to something custom, you can add a config file called shortcut.php in craft/config to override it:, (*10)

<?php
return [
    // Override Shortcut URL segment
    'urlSegment' => 'x',
];

If you want to remove the url segment completely and get urls like xxxx.tld/aBC123, you can enable the hideUrlSegment option., (*11)

<?php
return [
    // Hide url segment
    'hideUrlSegment' => true,
];

To use a custom domain, add the domain with the customDomain option., (*12)

<?php
return [
    // Set custom domain
    'customDomain' => 'https://cool.domain',
];

You can also control the length of the unique hash generated using the hashLength option., (*13)

<?php
return [
    // Set the hash length
    'hashLength' => 12,
];

Credits

Originally created by the team at Superbig., (*14)

Show your Support

Shortcut is licensed under the MIT license, meaning it will always be free and open source – we love free stuff! If you'd like to show your support to the plugin regardless, Sponsor development., (*15)

, (*16)

The Versions

04/06 2018

dev-master

9999999-dev

Simple URL shortening

  Sources   Download

MIT

The Requires

 

cms shortcut craftcms craft-plugin craft

04/06 2018

2.0.1

2.0.1.0

Simple URL shortening

  Sources   Download

MIT

The Requires

 

cms shortcut craftcms craft-plugin craft

14/11 2017

2.0.0

2.0.0.0

Simple URL shortening

  Sources   Download

MIT

The Requires

 

cms shortcut craftcms craft-plugin craft