Additional Parameters to "Link Existing Page" Page Type

Scott Lassiter asked on February 1, 2016 19:17

I have a situation where I have a bunch of pages that are added as "Link Existing Page" page types to Parent pages. These are not used as extra pages but are used to populate widgets on the parent pages, filling in parameters in a DIV or block on the page.

Structure:

Product (parent page, ie Golf Clubs)

  • product image information (Linked Page, ie: a form with 3 images that would be used for this product)

Can I add additional custom parameters for the Linked Page ONLY only for the case of that "specific" parent page? For example in my structure above, could I have a parameter that I could select to use the small image of the 3? Or maybe I could have a field to specify the size of the image, ONLY for that particular parent page. If the product was under a different parent page I might want to use the Large image.

The idea is that I have all of my product information kept on the one product page, however depending on the parent of the product, I could change one or more parameters.......

Maybe an alternate form would be of assistance?

Recent Answers


Martin Hejtmanek answered on February 2, 2016 07:36

Hi Scott,

There are several ways how you could model this, let me give you some ideas:

  • Add system field NodeCustomData to the form (of the linked type). NodeCustomData is stored per location in the tree as opposite to DocumentCustomData which is shared by links. Then create custom form control which will provide editing of this value for the given parent. Use node.NodeCustomData["SomeName"] to store that information, differentiation by parent will be done automatically for you, you can optionally use visibility condition, e.g. NodeLinkedNodeID > 0 to completely hide this field from original. This would probably be easiest and most upgrade-proof for smaller to mid-size projects. If your project is under 10k pages in total, I wouldn't hesitate and used this one. For more, it may be wise to run some load tests and review caching.

  • Model these "links" using Custom tables or Module classes, and provide custom form control to manage them on parent type. This may be little more complicated to do, but would provide most scalability. I would use it for large projects (where your total page count would exceed 50k pages). You may also need to provide custom data source to display this data on live site.

  • In v9, you can also use the new field type Related pages on the parent type, and add images through it. These are modeled through relationships and you can then use field RelationshipCustomData to store extra information. Scalability in this case would be good, there is a native support for displaying related pages, but you would have to either customize the existing form control (not upgrade-proof) or make a customized copy of it to provide editing interface for the extra information.

Hope this helps.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.