0

I have a web scoped feature that creates List instances based on list-Definitions and i want these lists to be created in a sub-site. I'm running into the issue that the custom web-parts that use these lists have to be deployed at the site collection level thus giving me a dependency error.

I have explored the idea of making all the features in my project scoped to site collection then attach event receivers to them and create the lists in the sub-site when the feature is activate. This approach seems like overkill- and will be hard for others to troubleshoot and maintain. I also could not get my modules to populate their content correctly but the lists worked.

I also had the epiphany that if i simply make the sub-site into its own separate site collection i could link to it from the original root site..., this works well, but then they don't share a common navigation so this was not an option.

I am now attempting to move the web-parts into user controls hoping that the user controls can be scoped at the web level and can be added to page layouts etc.

Does anyone know of the best practice approach to having list dependent webparts/usercontrols for a sub-site

2 Answers 2

1

Sounds like your lists have already been deployed in which case I would create a webpart with and editable property. During page_load check that the value is set, otherwise inform the user. Use a Custom property where you can validate the list as you set the value. This would also allow multiple Lists instances to be used (assuming you deployed a public list definition or not to technical validation)

0

I was able to get my desired result by making my web-parts, user-controls. This works for us since we don't really need end/power users adding/removing, re-sizing moving or interacting in any way with these controls other than reading from them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.