Perspective View Inheritance or Template?

Is it possible to create view that can be reused as a template for other views? For example if I created a view from say the Coordinate and then customized it. Could I then have other views inherit the properties, scripts, etc from this customized view?

If that View is in a project which is the parent project of other projects, then those children projects can use the View in an unmodified fashion, which would make the View identical in the children. Each child has the option to override the resource, at which point you can modify what is essentially a local copy of the original resource.

If changes are made to the original, the copy in the child will not receive those changes.

Example:

  • ProjectA is an inheritable “parent” project, with a View named “A”.
  • View A has all sorts of buttons and labels present.
  • ProjectB inherits from ProjectA.

ProjectB has View A as part of its content, and it is identical to the View in the parent. This View may not be opened/modified in the Designer if ProjectB is the current project in use because it doesn’t “own” the resource, even though it has the rights to use it.

If you override the resource, you can now open and modify the resource as desired in the Designer while using Project B, but since it is an entirely different file now, if you go and modify View A in ProjectA you won’t see those changes in the View A which resides in ProjectB.

thank you!

If I wanted to say have ProjectB to have many views that inherits ProjectA’s View named “A” how would I do that? Is the only way to just copy the view that’s from ProjectA?

Was kind of hoping I could just pick it when creating a new view in the “Root Container Type” as sort of a base to start off from.

Can you give some context to what you’re actually trying to use this for? It might give us some base to suggest potentially better or at least alternate ways of going about what you’re trying to do.

To answer your question though, yes, if you want multiple resources you’ll need to copy the base resource multiple times. Inheritance of resources works 1-to-1, you can’t have 1-to-many

good to know thank you! Still try to figure out the best way to do this but basically there might be a script and UI layout that will run on every view. It’ll check things like authentication mostly. We may not be able to use the Ignition defaults to do this so I’ve just been experimenting to see what’s possible so far.

At the heart of it I was looking for an event that gets fired on every view when loaded (I think the startUp event) is best? That runs the script and if the user is not authenticated it’ll re-direct the user somewhere.

On a side question. Is it possible to set and get a browser’s cookie?

Views do not inherit other views as a template in any way, short of the project-based inheritance I suggested already.

This is actually best handled as part of the Startup Event for the Page - not the View: Project > Session Events > Page Startup

No.

sounds good, I’ll give that a go. Thanks a lot for the help!