[Solved] How to create aliases (ex: for folders)?

I have lots of old content that I'd like to expose in a new site, but with a different folder hierarchy, while keeping the old structure intact (as a live archive).

Is there something like a "symbolic link" in Plone5?

I tried to install collective.alias without success.

The redirection tool is part of Plone 5.2 core

https://docs.plone.org/manage/upgrading/version_specific_migration/upgrade_to_52.html#merge-products-redirectiontool-into-core

Otherwise configure some rewrite rules in your fontend proxy.

collective.alias is not compatible with Plone > 4, and I bet it will never be, because the add-on is very complex and has some problems. I don't recommend using it even in Plone 4.x

You can achieve similar results using the standard Link content type. You can create the hierarchy of folders and links, pointing to the old content.

Both proposed solutions are redirecting; that's not what I'm looking for.
I want the same behavior than a symbolic link in Unix.
So a link to a folder would looks like a folder, and appear in the navbar.

In the past i developed a custom add on that implemented that, but had so many SEO side-effects to deal with that it was not worth to maintain it (and moved to a solution with redirection tool).

I gave up... Thanks.

Exactly. Every alias solution sucked in their own way with many disadvantages and little gain.

1 Like

This is indeed a complex task. We did something like this for a client one (based on a relation and a custom traverser) and are in the process of reimplementing the same feature in a different way based on how the Assets-Folder LanguageIndependentFolder of plone.app.multilingual work. See plone.app.multilingual.content.lif.connect_with_others for the basic idea of pointing _tree to the tree of the folder to mirror.

If it works out it should allow you to create a type 'Mirror' that mirrors the content of a folder that you can select. The content inside the mirror folder will be editable, linkable and searchable. You can have multiple mirrors to one folder and these mirrors should be able to be translatable.

Our use-case is to offer the content of a folder containing language-independent products that should be visible and searchable in different places of a multilingual website with language-specific domains.

The old implementation is still used here: https://www.dyna-jet.com/hochdruckreiniger

I will post here once it is available.

Same here. We developed a complex solution for a client project. The project supported complex page composition (multiple blocks per page), multiple languages, and multiple versions of the same file. Therefore a solution is definitely possible. Though, the experience in real life is pretty bad. Editors just completely loose track of those aliases and it confuses the hell out of both users and editors.

My personal 2c are: avoid mirroring at all costs. If you have to implement something like this it will be painful. I am not aware of any system on the market that offers that feature and at the same time is not a horrible mess in real life.

Although not what you ask for, but I once made a very simple add-on to deal with links (that had changed).
Maybe it can be of some help for similar situations(?)

Teoretically: Could it be possible to make an alias content type which loads content inline with patterns-lib / pat inject ?
That would prevent content from beeing 'SEOed' double/twice (?)

You would still have to deal with leadimage, icons description etc.

<div id="pat-target-${my_id}">
<a href="${view/item_url}"
  class="pat-inject" data-pat-inject="target: #pat-target-${my_id}; trigger: autoload; source: #content">Loading…</a>
2 Likes

It looks like a goods idea, but until there's a ready-made solution I'll move the old content to the most appropriate container in the new site. I agree with all the expressed concerns, and realize that a public web site is not like a private Unix file system... The builtin URL management is already taking care of most of the important issues, without breaking anything, and content editors don't even have to know about it.

1 Like

We published https://github.com/collective/collective.mirror that should solve this problem. The package has no documentation or tests yet but we already use it in a project and it works just fine.

1 Like

I get this error when saving a new mirror object:
zope.intid.interfaces.IntIdMissingError: <Folder at /dev/en/news>
("/dev/en/news" is the Master Container)

Thanks for the report.
We'll have a look next week when we continue working on that project. We'll still have to look into a couple of possible issues (e.g. relations to objects in mirrors).