eZ Community » Forums » eZ Publish 5 Platform » Locations and cross-siteaccess links
expandshrink

Locations and cross-siteaccess links

Locations and cross-siteaccess links

Thursday 22 January 2015 1:01:50 pm

We have set up an eZPublish 5.3 (soon to be 5.4) solution where we need to have a separate design and menu for some parts of the solution. This we have accomplished by setting up a siteaccess with its own content tree_root location_id in ezpublish.yml. Then, based on the siteaccess, a separate pagelayout is called, and we can also override the twigs we need to based on siteaccess. Perhaps not ideal, but it works for the layout and menu.

The issue we're having now is with cross-siteaccess links and the fact that we have content located in more than one siteaccess.The latter is because an article can have different layout/design based on which siteaccess users are viewing it from.

For instance, say we have an article located at dummydomain.no/articles/my_article as its main location. And also we wish to display this article in the other siteaccess, but with different layout and some added content and such. So this article then also has another location in dummydomain.no/othersiteaccess/someplace/my_article. Now the issue is with the links displayed in this article when in othersiteaccess, they will then point to dummydomain.no/othersiteaccess/link-to-related-content-in-article. The only problem is that this related-content might not be in othersiteaccess, but in the original location (but because the links are relative I guess it tacks on the siteaccess route in front?). This is somewhat hard to explain just by text, but I'm giving it a try.

Also, we have a problem with related content when we wish to not display the main location url. I have seen this page: https://doc.ez.no/display/EZP/ez_urlalias for examples on getting an url when we don't have a location object (for instance when we need to list object relations). But, this only gets the url based on the main location, and when I'm on othersiteaccess I want the location that is based under THAT siteaccess, not the other one (main location). I have seen this article as well https://doc.ez.no/display/EZP/Cross+SiteAccess+links, but this means we need to send the siteaccess along everytime we call path or url in a twig? And again, what is the easy solution here if we don't have the location object but just the contentId?

I'm wondering now if I should write a twig extension that i can call from a twig where I need a url based on siteaccess and contentId, where I do a search and load a location based on rootnode, and then send this back to the twig.

This was hard to explain, but I hope it made some sense. Any comments would be welcome. We are new at both symfony and ezpublish 5 (but know a lot of ez 4) so if there might be better ways to solve this than what we are trying.

No reply yet!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from