LogoLogo
v1.4.0
v1.4.0
  • 🌸What is Petal Pro?
  • πŸ’‘Changelog
  • ⏫Upgrade guide
  • Guides
    • πŸš€Creating a web app from start to finish
  • πŸ‘©β€πŸ³Recipes
    • πŸ’How to apply a recipe with git cherry pick
    • #️⃣UUIDs
    • ✍️First/Last name
    • πŸ“¦NPM packages
    • πŸ—ΊοΈGoogle Maps
  • Fundamentals
    • πŸ’ΏInstallation
    • πŸ“‚Folder structure
    • πŸ—ƒοΈIncluded Pages
    • πŸ˜€Users & Authentication
    • 🏒Organizations & Multitenancy
    • 🧊Components
    • ⬛Dark mode
    • 🎨Branding
    • 🌱Seeding
    • πŸ“„Layouts & Menus
    • πŸ› οΈBackground Tasks and Jobs
    • πŸ”§Util & Helpers
    • πŸ“§Emails
    • πŸͺJavascript Hooks
    • πŸ“šExtra Hex Libraries
    • πŸ—οΈGenerators & Page Builder
    • πŸ—£οΈTranslations
    • πŸ–οΈContributing
    • πŸ›«Deployment
    • πŸ›‘οΈTesting
Powered by GitBook
On this page
  • The `_petal_framework` folder
  • How do I modify Petal Pro components?

Was this helpful?

  1. Fundamentals

Folder structure

PreviousInstallationNextIncluded Pages

Last updated 2 years ago

Was this helpful?

The `_petal_framework` folder

Anything related to Petal Pro that developers shouldn't need to modify are put in a separate folder called _petal_framework (we didn't name it _petal_pro because our project renaming script would overwrite the module names).

There is also another folder like this for our generator templates:

For upgrading purposes, we recommend never modifying files in these folders directly.

How do I modify Petal Pro components?

Simply duplicate them into your own namespace. For example, you might want to modify our email components to jazz them up a bit:

You will then need to rename the module, eg. from PetalFramework.Components.EmailComponents to YourApp.Components.EmailComponents.

Then do a global search for where you import or alias that component. eg if I search for PetalFramework.Components.EmailComponents I see it here:

defmodule PetalProWeb.EmailView do
  use PetalProWeb, :view
  alias PetalFramework.Components.EmailComponents
end

I just need to change that alias to my new duplicated component:

defmodule PetalProWeb.EmailView do
  use PetalProWeb, :view
  alias YourApp.Components.EmailComponents
end

Now you can modify the component to however you want.

πŸ“‚
Petal Pro files that devs can ignore
Petal Pro template files (eg. mix petal.gen.live)