Jump to content

Page as Symbolic link other Page


Recommended Posts

It would be cool to designate page symlink another page.

That would need addressing at a different page (symlink), runs and shows the referenced page, including all its content*, so would the same content was available in two completely different locations.

This is useful for example for multicategory, availability of books both the author and the year of release while preserving the path in the address bar.

Link to comment
Share on other sites

This is doable with current tools already; you can either find/get specific page and render it with $page->render() at any given location (i.e. other existing page or even when a page isn't found by hooking to ProcessPageView::pageNotFound) or use URL segments to create fake page paths.

To be honest this doesn't sound like something that would need to be implemented as a built-in feature.

Edit: by the way, this thread is owning Google search results for keyword "svoesoderzhimoe".. :)

Edited by teppo
  • Like 2
Link to comment
Share on other sites

This is doable with current tools already; you can either find/get specific page and render it with $page->render() at any given location (i.e. other existing page or even when a page isn't found by hooking to ProcessPageView::pageNotFound) or use URL segments to create fake page paths.
Such way it is necessary to watch use of segments, the page has to have plus the template, by default segments are limited to 4.
I want to see the similar decision for realization of a multi parents.
 
svoesoderzhimoe

= своё содержимое as this contain

Link to comment
Share on other sites

This is pretty much how I'd solve this, still no need for any core changes or additions :)

Create new template called "symlink", add page type field "symlink" with value limited to single Page (use PageListSelect as input field type) and then in template file do something like this:

<?php
if ($page->symlink instanceof Page && $page->symlink !== $page) echo $page->symlink->render();
else throw new Wire404Exception();

Now you can add as many symlinks you wish and easily choose which page each is tied to. Don't forget to add canonical tags to let robots know which version of this page is the "original" one, though, or you'll have serious SEO issues.

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...