0.1experimentalYOURLS

Integrate with the YOURLS directly from your Symphony Entries

Clone URLhttps://github.com/newsdeeply/yourls.git

Add as a submodulegit submodule add https://github.com/newsdeeply/yourls.git extensions/yourls --recursive

Compatibility

2.x.x2.1.x2.2.x2.3.x2.4.x2.5.x2.6.x2.7.02.7.12.7.22.7.32.7.42.7.52.7.62.7.72.7.82.7.92.7.10
NoNoNoNoNoNoNoNoNoNoNoNoNoNoNoNoNoNo. Soon?

Readme

YOURLS

A Symphony extension that integrates with YOURLS

Installation

  1. Upload the yourls folder to your Symphony /extensions folder.
  2. Enable it by selecting the "YOURLS", choose Enable from the with-selected menu, then click Apply.
  3. Add your domain and signature values to your Preferences
  4. You can now add the "YOURLS" field to your sections.

Usage

Developer

The goal is to create a Symphony page that best represents your content as a permalink. The classic example of this is a blog with articles. The permalink structure might be /article/135/my-article.

Defining the URL Structure

Add the YOURLS field to your desired section, and enter the URL Structure of your permalink. The URL Structure field accepts full XPath expressions which will be evaluated against the XML of the Entry when saved.

For example, let's assume your permalink structure is /article/:year/:month/:date/:id/:handle and you have a simple section with a Text Input, Date and YOURLS field. The XML for a single entry may return something like the following XML:

<data>
    <entry id="174">
        <title handle="hello-moto">Hello moto</title>
        <date iso="2013-11-11T23:04:35+10:00" time="23:04" weekday="1" offset="+1000">2013-11-11</date>
        </entry>
</data>

The URL Structure for the relevant permalink is:

/article/{substring(entry/date/@iso, 0, 5)}/{substring(entry/date/@iso, 6, 2)}/{substring(entry/date/@iso, 9, 2)}/{entry/@id}/
Custom Slugs

By default, short URLs generated by YOURLS will be automatically generated, however if 'Allow custom slugs' is enabled, Authors will be able to enter their own slug which YOURLS will then use for the short URL.

Author

  1. Opens the section and creates a new Entry
  2. If the field allows custom slugs, an input field is shown asking the author for the custom slug.
  3. Author enters custom slug, or leaves it empty (autogenerated) and hits Create Entry
  4. A new shortlink is created in YOURLS which references the URL structure set in the field, eg. http://example.com/article/135/my-article

Version history

Requires Symphony 2.3.3

  • Initial package