Entry Shortlinks
This is an open discussion with no replies, filed under Extensions.
Search
Create an account or sign in to comment.
This is an open discussion with no replies, filed under Extensions.
Create an account or sign in to comment.
Quick Links
Symphony • Open Source XSLT CMS
--with-xsl
)
Hey there! Do you guys include direct links from backend entries to frontend pages in your projects? For me this has become an essential part of nearly every project I build with Symphony and after initially fiddling around with building the full links directly in the backend (first using Entry URL Field, then with the help of Link Preview) I've now settled with mostly using simple ID-based shortlinks instead.
Meaning I use something like
/id/123
in the backend and build a 301-redirect that forwards that shortlink to a full URL like/projects/category/title-of-the-project/
.This is also super-useful if you let your clients include internal links in formatted text content! If you instruct them to only use shortlinks you can always change the structure of your full URLs later – without having to worry about broken links hidden in text content.
And while these kind of shortlinks can easily be built using Link Preview I noticed that this approach can cause a significant rise in pageload-time of publish index views when using complex sections and/or lots of entries. So I decided to build my own tailor-made extension for this technique: Entry Shortlink.
It's basically a stripped down version of Link Preview (Big thanks to Nicolas for all the ideas and code I could borrow from there) that cuts away all the overhead in data-loading and solely relies on the entry ID as dynamic part of the URL – which offers a significant speed boost in the abovementioned scenario :)
Shortlinks : Setting up pages and redirects
And as I've already written it down for the extension's readme – here's a small overview of the additional steps I take to poperly set up pages and redirects for the Shortlink-technique:
id
, attach the url-parameterentry-id
and give it the typesheaders
and301
.System ID
by theentry-id
-parameter, include all elements that are needed for building the final URL and attaching the datasource to the Shortlink page.Hope the extension comes handy for some of you & would love to hear your thoughts and feedback!