I have an asset that I built that the class extends from Asset. Currently, when I create my new asset type, it does not get a web path given to it. (Yes, it should be getting a web path, any other asset gets one in the same create location.) I have to manually give it a path, then it will work fine and be viewable.
What would be the reason it is not getting a path automatically? When extending from Asset, do I need to specifically tell the asset that it should get a webpath?
UPDATE: Ok, I solved my own problem. I extended from page instead, and it solved all my problems.
Classes and Extends
nnhubbard
(Nic Hubbard)
#1
Luke_Wright
(Luke Wright)
#2
Just for your information, you are correct in stating that assets do not get a web path automatically. Most assets in Matrix are extended from simple assets like Page, Folder, File, User etc, that do create a web path upon their creation. However, they don't necessarily make sense for all assets Matrix can use, which is why this is not done at a base Asset level.
If you're curious about the code involved, the _createAdditional() methods of Page or Folder assets are a good place to start. Hope this helps