Sitecore / jss

Software development kit for JavaScript developers building web applications with Sitecore Experience Platform
https://jss.sitecore.com
Apache License 2.0
261 stars 275 forks source link

Create custom App template on initial import #54

Closed coreyasmith closed 6 years ago

coreyasmith commented 6 years ago

When you import an application, the root App item is based off of the /sitecore/templates/JavaScriptServices/App template. It'd be nice if a custom App template that derives from the base /sitecore/templates/JavaScriptServices/App template were created for you on initial import, similar to the custom App Route template.

It'd also be nice to be able to customize this item for the initial import--specify base templates you want it to inherit, item name, icon, etc.

kamsar commented 6 years ago

That's the point of the app route template; any other route templates you define using addRouteTemplate will derive from the app's default route template (app route)


From: Corey Smith notifications@github.com Sent: Sunday, September 2, 2018 1:57:17 PM To: Sitecore/jss Cc: Subscribed Subject: [Sitecore/jss] Create custom App template on initial import (#54)

When you import an application, the root App item is based off of the /sitecore/templates/JavaScriptServices/App template. It'd be nice if a custom App template that derives from the base /sitecore/templates/JavaScriptServices/App template were created for you on initial import, similar to the custom App Route template.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Sitecore/jss/issues/54, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAGU_UdXEEzA6MratxNsYnJ3CT21qEftks5uXEYtgaJpZM4WWwv9.

This message and its attachments are for the designated recipient only and may contain proprietary or otherwise confidential information. If you have received this message in error, please notify the sender immediately and delete the original. Any other sharing, copying or use of this message by you is strictly prohibited.

coreyasmith commented 6 years ago

I've got a couple of base templates that I'm adding to the App template, like _Error Handling for a Page Not Found Link field, to handle server-side errors and other things. It'd be cool if I could create a not-found route while I'm working in disconnected mode, and tell JSS that my App item should add _Error Handling as a base template and use that not-found route for the Page Not Found Link field on initial import.

Maybe an app.yml item could be defined under the /data/content folder? You could define template (is it possible to define multiple?), icon (🍄), and fields.

I know I can do all of this by creating a custom App template before the initial import and define that template as the appTemplate on my <app /> in config, but that feels a bit too connected.

kamsar commented 6 years ago

tbh this sounds like pipeline customizations to the import process. The goal of import out of the box is to enable comping up a site, as opposed to complete serialization of final items - ergo, extend import or serialize the items.