
I understand there are two approaches to create a page that is compatible with both lightning and classic
1. Create a lightning component and use lightning out to render it on a visualforce page
2. Create a vf page following the lightning design system and manage navigation for the lightning and classic UI's
I need to override the standard 'view' layout with a custom page that is compatible with both UI's. Is approach 2 a simpler approach to achieve this?
Also, in general, what are the pros and cons of these two approaches of creating custom pages compatible with both UI's?
1 risposta

Hi Carine,Both approaches are okay but I would prefer ⌗1. That way you would be able to use some standard lightning components, preferably input tags, in the custom components that you are using that might make your work easier.While using the lightning component in your VF Page, you won't be able to use any standard lightning actions such as force:showToast etc. as they are not supported in VF page but they are supported in lightning components that are directly rendered(without a VF page being the container) in the lightning experience. This goes with both the above approaches because you'll be overriding a button with a VF page and it will reflect the same in both Classic and LEX. Cons:
- If the object layout changes, you'll have to add the fields to the page. This means changes to the client side and server side code(probably) whenever the layout changes.
- If you have multiple record types for the object and the layout is different for each record type, I believe you'll have to show the fields regarding the layouts which is what you'll need to handle.
Hope this helps.
Thanks,Nagendra