Dittofi
  • Tutorials
    • Tutorial Index
    • Quick Start
    • Dittofi Essentials
      • Part 1: Frontend terms and concepts
      • Part 2: Backend terms and concepts
      • Part 3: Connecting frontend and backend
      • Part 4: Dittofi app structure
    • Dittofi App Design
      • 🏗️App architecture 101
      • ◼️Backend app development 101
      • 🟪Frontend app development 101
      • 🔰(optional) Web developer beginner series
  • Learn Frontend
    • 👨‍💻Getting Started
      • Welcome to Dittofi
      • Intro to the Dittofi Design Studio (Frontend)
    • 🟩Pages
    • 🟪Elements
      • Types
        • Button Element
        • Div Block Element
        • Form Block Element
        • Link Block Element
        • List Element
        • Modal Box Element
        • Tabs Element
        • Columns Element
        • Image Element
      • Partials
      • Prefabs
      • Custom
    • 🟧Variables
      • Array
      • Checkbox
      • Collection
      • Collection (Custom Model)
      • Collection (System Custom Model)
      • Custom Model
      • Date
      • Datetime
      • File
      • Json
      • Number
      • Number with decimal
      • Model
      • System Custom Model
      • Text
      • UUID
    • 🟨Events
      • 🟨External
        • HTTP Request
        • Run Endpoint
      • 🟨Flow Control
        • Condition
        • Run Action
        • Loop
        • Sleep
      • 🟨Maths
        • Add
        • Divide
        • Modulus
        • Multiply
        • Subtract
      • 🟨Navigation
        • Open Page
      • 🟨Notifications
        • Alert
        • Confirm
      • 🟨Other
        • Copy To Clipboard
        • Run Custom
      • 🟨Text
        • Concat
        • Contains
        • Ends With
        • I Contains
        • I Ends With
        • I Starts With
        • LTrim
        • RTrim
        • Text To Upper
        • Text To Lower
        • Trim
        • Starts With
      • 🟨Variables
        • Set Field
        • Remove Field
      • Validate
    • 🟦CSS Layouts
      • Holy Grail Layout
      • Side Bar Layout
      • Sticky Footer Layout
      • Sticky Header Layout
      • CSS Frameworks
    • 🔲CSS Frameworks
    • Component Libraries
    • Meta Attributes
  • Learn Backend
    • 🖥️Getting Started
      • Intro to Data
      • Intro to APIs
      • Build your first custom API
      • Actions & Events
    • 🟫Back-End Actions
    • 🟩Custom Models
      • 🟩Attributes
        • Array
        • Checkbox
        • Custom Model
        • Collection (Custom Model)
        • Collection (System Custom Model)
        • Date
        • Datetime
        • File
        • Number
        • Number With Decimal
        • Json
        • Text
    • ◼️Data Models
      • Database Fundamentals
        • Database relationships
      • ◼️Columns
        • Attachment
        • Auto Increment
        • Checkbox
        • Date
        • Datetime
        • Duration
        • Email
        • Long text
        • Link to another record field
        • Number
        • Number with decimal
        • Password
        • Phone number
        • Percent
        • Price
        • Rating
        • Single select
        • Single line text
        • URL
    • 🟥Events
      • 🟦Arrays
        • Append
        • Array Pop
        • At
        • Length
        • Prepend
        • Range
      • 🟦Conversions
        • Base64 Encode
        • Base64 Decode
        • Json Decode
        • Json Encode
        • Path Escape
        • Path Unescape
        • Query Escape
        • Query String Parse
        • Query Unescape
        • To Bool
        • To Float
        • To Int
        • To Str
        • Yaml Encode
        • Yaml Decode
      • 🟦Database Requests
        • Create
        • Create Or Update
        • Delete
        • Has Record
        • Read Event
        • Update
      • 🟦External
        • HTTP Request
        • SFTP Download
        • SFTP Upload
      • 🟦Files
        • CSV Reader Event
        • CSV Writer Event
        • File Read
        • File Save
        • File Size
        • File Type
        • JSON Reader
        • PDF Generator
      • 🟦Flow Control
        • Condition
        • Loop
        • Return
        • Run Action
        • Sleep
      • 🟦Notifications
        • Send Mail
        • Connect Websocket
        • Message Websocket
      • 🟦Maths
        • Add
        • Acos
        • Acosh
        • Asin
        • Asinh
        • Atan
        • Atanh
        • Cbrt
        • Ceil
        • Divide
        • Modulus
        • Multiply
        • Subtract
      • 🟦Security
        • Compare Password
        • JWT Decode
        • JWT Encode
        • Login
        • Logout Web User
        • Password Generator
        • Random Number
      • 🟦Time
        • Add Time
        • Day
        • Format Time
        • Minute
        • Nanosecond
        • Parse Time
        • Second
        • Time In
        • Year
        • Year Day
      • 🟦Text
        • Concat
        • Contains
        • Ends With
        • Execute Template
        • I Contains
        • I Ends With
        • I Starts With
        • Starts With
        • LTrim
        • RTrim
        • Replace
        • Regex Find All String
        • Regex Find String
        • Regex Match String
        • Trim
        • Text To Lower
        • Text To Upper
        • Text To Title
        • Url Getarg
      • 🟦Other
        • Assign
        • Run Custom
        • Redirect Web Page Event
        • Render Web Template Event
    • 🟧Variables
      • Array
      • Checkbox
      • Collection
      • Collection (Custom Model)
      • Collection (System Custom Model)
      • Custom Model
      • Date
      • Datetime
      • File
      • Json
      • Number
      • Number with decimal
      • Model
      • System Custom Model
      • Text
      • UUID
    • 🟪Webservices
  • Templates
    • Two sided marketplace template
      • Introduction
        • Part I: Installing and setting up the marketplace template
        • Part II: Understanding what features are included in the marketplace template
        • Part III: Customizing your marketplace frontend without coding
        • Exploring Dittofi's marketplace API
      • Listings
        • How to create a marketplace listing
    • How to build a CRUD app
  • Third Party APIs
    • OAuth 2.0 APIs
      • Introduction To OAuth 2.0
      • Google OAuth 2.0 - PART I
      • Google OAuth 2.0 - PART II
  • Dittofi Admin
    • Your Account
      • Workspace Admin
      • Manage Billing
      • Connect a custom domain
      • How to use a discount code to Dittofi Pro
  • FAQ
    • API Generator
    • How to write custom SQL?
    • Why does my image not display?
    • How can I set up Google Analytics?
    • Exporting and deploying my frontend code
    • What is a partial and what is a prefab?
    • How to set up a basic mulit tenant app on Dittofi
    • How to write a custom endpoint in Dittofi
    • How to integrate Font Awesome into Dittofi
    • How can I set up Dittofi to run on my own private server?
    • How to add roles such as Super Admin, Admin, Manager & User
    • How to prevent duplicate records being added to the database
    • What to do when relation cannot be created because their is violating data in the referenced table
  • Change Logs
    • Dittofi Change Logs
Powered by GitBook
On this page
  • What is a partial?
  • How to find, edit and delete partials?
  • What is a Prefab
  • How to find, edit and delete prefabs?

Was this helpful?

  1. FAQ

What is a partial and what is a prefab?

PreviousExporting and deploying my frontend codeNextHow to set up a basic mulit tenant app on Dittofi

Last updated 2 years ago

Was this helpful?

In this article we are going to look at what is a partial and what is a prefabs. Both of these concepts are exclusively for frontend app development on Dittofi. You cannot create a partial or a prefab for any backend code.

Let's kick off by taking a look at:

  • What is a partial?

  • How to find, edit and delete partials?

Then we will look at:

  • What is a prefab?

  • How to find, edit and delete prefabs?

What is a partial?

When you are building the frontend of your app, there may be parts of the frontend that you want to reuse multiple times. For example, you might design and build a form and then want to reuse this form in multiple points of your app. To speed things up, Dittofi allows you to design and build a component, such as a form. Save this component as a "partial" and then reuse this partial throughout your app.

For example, consider the following design and build of a login form.

This form is built out of several elements that can be viewed inside the Navigator, as below.

To save down the layout and styles of this form, you need to (1) select the form, (2) click on the three white dots in the bar on the form and (3) choose the option to "create partial" from the popup.

How to find, edit and delete partials?

Once you've done this, your form will be saved as a Partial that you can reuse in your app development.

All of your partials are visible under the Elements tab, as shown below.

You can edit the name and description of your partial by clicking on the downward facing arrow next to your partial and clicking "Edit Partial", as shown below.

You can also delete the partial from the same place.

Once you've created a partial you can reuse it anywhere within your app by dragging and dropping the partial onto the apps canvas. This is shown below, where we add our Form Partial to a column element.

After you've added the partial to your app, you are able to make changes to it, however please note, editing a partial will impact all versions of the partial that are used within your app.

To edit a partial, you need to double click on the partial and then you can edit it, as shown below.

NOTE

Partials update everywhere that you use them. As you will see in a moment, Prefabs do not update everywhere that you use them.

What is a Prefab

A Prefab is the same as a Partial but with one crucial difference, editing an instance of your Prefab will not update all instances of your Prefab throughout your app.

To illustrate this, let's take the example of our form again and, instead of turning the form into a Partial, let's turn it into a Prefab by (1) selecting the form, (2) clicking on the three white dots in the bar on the form and (3) choosing the option to "create prefab" from the popup.

How to find, edit and delete prefabs?

You are able to find prefabs under the elements tab as shown below.

The name and description of the prefab can be edited from under the downward facing arrow, as shown below.

You can also delete the prefab in the same place.

Once you've created a prefab you can reuse it anywhere within your app by dragging and dropping the prefab onto the apps canvas. This is shown below, where we add our Form Prefab twice into two column elements on our page.

After you've added the prefab to your app, you are able to make changes to it. Note, editing a prefab will NOT impact other instances of your prefab within your app.

To edit a prefab, you can click on the element inside the prefab that you want to edit and then change it. For example, we might want to update one of the forms below to just look like a form to recover passwords.