-
Notifications
You must be signed in to change notification settings - Fork 13
_Prtcl dev guide 7: Displaying an entity
In your index.html
, let's include these elements inside our body:
<module-container>
<cortex-entity id="root-entity"></cortex-entity>
</module-container>
The module-container
element serves to access any dependency stored in the MicroOrchestrator
from any element defined inside its structure.
And (more importantly) the cortex-entity
element serves to fetch and render any kind of content-addressable object from its hash, using all the modules we have loaded in our application. It is the entry point for the @uprtcl/lenses
generic rendering engine framework.
Now, let's create a text-node
using our documentsProvider
:
const createdDocumentId = await documentsProvider.createTextNode({
text: 'Hi!',
type: TextType.Paragraph,
links: []
});
document.getElementById('root-entity').hash = createdDocumentId;
And that's it! If you load your project in a browser, you should see your text rendered.
Nice work! If you want to power up the funcionalities of your app, follow the trail to 8 - Adding the Evees module.
_Prtcl resources: Overview, Spec, Dev guide, API reference
4 - Configuring service providers
6 - Loading modules with micro-orchestrator
[TBD]10 - adding lens selection
[TBD] Using Cortex without modules
[TBD] Building a pattern
[TBD] Building a lens
[TBD] Building a service provider
[TBD] Building a Cortex module
[TBD] Customizing the lenses module
[TBD] Building a plugin for the lenses module