This Tutorial will help you understand how to create favorite lists based on N data sources.
Users can go to the Favorite and edit their Favorite: Re-order or delete Favorite.
To understand this App & Tutorial, you need to be familiar with
- EachScape Studio
- Live Data Feed
App Set up Overview
The core of the Favorite App are
- The Favorite Layout.
- 2 Actions
- Add to Favorite
- Remove from Favorite
- The 'Fave' Database
The Favorite app uses a standard feed (BBC Entertainment in this example) and let users add articles as favorites.
When a user tap the Add to favorite icon, accessible as a Disclosure in the List Block of the first view of the app : News from Feed we simply call the 'Add to Favorite Action':
The Add to Favorite copies the Record into a local Database named 'Fave'
Favorite are stored in the 'Fave' Database.
To list the Favorite, you need to use the 'Favorite Layout' and display the content of Fave.
The text block on top of the first view switch to the view '2.Favorite' which contains the Favorite Layout
Favorite Layout displays the
- Favorite Block and
- Editable Block
You MUST have defined these Blocks as MyBlock.
In most cases you will use a Canvas as these Blocks are listed as line item.
The MyBlock we use is 'Favorites - Layout Row'
Accessible via MyBlocks:
Because Favorites are saved in Fave when you build your layout, will need to replace ALL access to DS content by Fave:
- Select the content you want to display as usual from a Datasource
2. REPLACE the ds: by the fave:
Repeat for ALL piece of content you want to display, it will look like this in the Bloc Setting:
Delete a Favorite
The Favorite Layout automatically handles Favorite Management on your behalf.
If you swipe left on a Favorite Line item the Delete option will show up.
you can also use the 'Remote from Favorite' action.
As for the Add to Favorite, specify to which DS (not Fave) the Favorite is attached.
The system will update the Fave DB automatically.
You can call this action from any object from the Favorite Layout: