November Happy Hour will be moved to Thursday December 5th.

Property Type for Non-permanent Relative URL

Vote:
 

I'm working on a site that will have a bunch of "subfolders" under the root, which represent individual franchise sites. When it comes to page structure, each subfolder will be identical. E.G.

Root
-FranchiseTemplate
--Page1
--Page2
-Franchise1
--Page1
--Page2
-Franchise2
--Page1
--Page2

We intend to keep the franchises up to date by applying changes to the FranchiseTemplate version and copying those out to the franchise roots. So if Page1 links to Page2, I need it to use a relative URL so that it always links to Page2 in its own directory. If it were a PageReference or a permanent link, it would link back to FranchiseTemplate's page. What type should I use for this page property? I'd like for an editor of FranchiseTemplate/Page1 to be able to browse and select FranchiseTemplate/Page2 rather than have to type in the URL, but what should be stored is "Page2" or "./Page2". (Note: the pages might not all be in the same container under FranchiseTemplate so we may need something like "../../News/Page3".)

#121462
May 11, 2015 17:46
Vote:
 

Are you sure you need a property? Maybe you could programmatically find the page you want linked from the template's code.

I guess you could have a pagereference-property within the template-tree that you change to the corresponding copied node when the copying occurs (by listening to events).

#121463
May 11, 2015 18:07
Vote:
 

Well, I do want it to be a property so that non-technical editors can set up the links. Your suggestion may work, but we'll have to determine if its worth it verses just using relative URL strings. If it redirected the references in response to say, a page created event, we'd have to make sure the pages were all created in a very specific order, right?

I was also wondering if the PageReference editor could still be used, but its value intercepted and changed to a relative link before being set. Maybe just in the property setter? Or by some other means. Like a value converter if you're familiar with WPF.

What we're actually looking at right now is creating a partial router to let us use pages directly from the template site if they don't exists locally (so they can share pages that won't have any differences from franchise to franchise) and will also let us rewrite outgoing page URLs to point at the local version's URL.

#121516
May 12, 2015 21:22
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.