Add the ability to set the segment in the PublishedRouter #13594
drpeck
started this conversation in
Features and ideas
Replies: 2 comments 8 replies
-
This commit should be the totality of the change: |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @drpeck |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As things stand
The
PublishedRouter
handles creation of theVariationContext
. It sets theCulture
property with a value supplied by theIPublishedRequestBuilder
. No segment is set.The
IPublishedRequestBuilder
has aSetCulture
(link), the value of which is used for setting the culture on theVariationContext
(link). This method might be called by a content finder for example. There is no such comparableSetSegment()
method.Proposal
Would you support a PR that adds a
SetSegment()
to the IPublishedRequestBuilder, and also modifiesPublishedRouter
to use this set value when creating thenew VariationContext()
?AFAIK the best current approach to set the
Segment
property on theVariationContext
is by using aRoutingRequestNotification
. In my case I'm identifying the segment in aIContentFinder
(based on the URL) and then having to calculate the same value again later in aRoutingRequestNotification
to set theVariationContent
. This is because theVariationContext
is overwritten after the content finders have run. This double handling could be avoided with this approach.Beta Was this translation helpful? Give feedback.
All reactions