# Better know a framework #26: Dynamic ViewFactory

**URL:** https://discourse.aurelia.io/t/better-know-a-framework-26-dynamic-viewfactory/3392
**Category:** Framework Knowledge
**Created:** [April 13, 2020, 2:22am UTC](https://discourse.aurelia.io/t/better-know-a-framework-26-dynamic-viewfactory/3392 "2020-04-13T02:22:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)
#### Post date: [April 13, 2020, 2:22am UTC](https://discourse.aurelia.io/t/better-know-a-framework-26-dynamic-viewfactory/3392/1 "2020-04-13T02:22:07Z")

</div>

Awhile ago, I created this topic [Better know a framework #18: what processContent is and what it is used for](https://discourse.aurelia.io/t/better-know-a-framework-18-what-processcontent-is-and-what-it-is-used-for/1785) to help folks understand more about `processContent` and its common usages.

There’s another usage that `processContent` enables: dynamic view factory per usage. This is achieved via setting the `viewFactory` property on a custom element instruction to override the default view factory associated with it (the custom element).

A contrive example of this would be a `<field/>` custom element, that will determine where should the `<slot>` element is, based on its content. Normally dynamic slot position cannot be achieve in shadowDOM emulation. But with `processContent` and dynamic view factory, we can easily support it.

Example here [https://gist.dumber.app/?gist=6ecafbe67a10f6a22dc2e36e859c2418&open=src%2Ffield.js](https://gist.dumber.app/?gist=6ecafbe67a10f6a22dc2e36e859c2418&open=src%2Ffield.js)

P.S: thanks @MaximBalaganskiy for asking about this
