Skip to content

newsdeeply/yourls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Symphony extension to integrate with the YOURLS tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages