This project is read-only.

Extending resource types

Topics: Core, General
Jun 5, 2015 at 10:11 AM
As Google polymer components are stepping up, I would like to have the ability to include them in views similar to Script.Include() or Style.Include().

I've already extended (in Orchard.Framework):
  • ResourceManifest - added ResourceDefinition DefineComponent()
  • ResourceDefinition - added component to _resourceTypeTagNames, and similar changes that make sense to me
  • IOrchardViewPage - added ResourceRegister Component property and implemented it in all three classes that inherit this interface.
Now, it seems that I'm missing something, as it all goes fine, no errors, but tag is not rendered on the page, so please if you can help me and tell me what am I missing.
Jun 5, 2015 at 11:41 PM
It's hard to say from this. Can you point to the full source?

BTW it's generally not advised to modify Orchard's core, but I don't know enough about this topic to tell how you could do this without mods.
Jun 5, 2015 at 11:52 PM
Let's say here I added one more entry:
{ "component", new Dictionary<string, string> { {"rel", "import"} }
 {"component", "components/"}
and here :
 ResourceRegister Component { get; }
with its implementation in classes that implement this interface. After those changes Component.Register() and Component.Include() are available.

I know it's a bad practice to change core code, but if someone has a proposal how to achieve this with no core changes, I'm open for suggestions.
Jun 24, 2015 at 2:45 PM
good idea