Display Realtime Document Data

This shortcode will help to retrieve data from Realtime database and display it as a table on your page or post.

Remember to set the security rule for your database, so the right people can read your document.

// show realtime data basing on collection name & document id
// Collection & Document will be come path of the Realtime database --> /users/123456

// Show item as table
[realtime class='your-class-name' collection_name='users' document_name='123456' display_fields='firstName,lastName,email,phone,age,gender,food,hobbies' images='imageUrl']

// Show item as blocks
[realtime class='your-class-name' collection_name='users' document_name='123456' display_fields='firstName,lastName,email,phone,age,gender,food,hobbies' images='imageUrl' display_type='blocks']

I suggest that you also add this shortcode to show any error when retriving data:

[firebase_error class='your-class-name'][/firebase_error]

It will get the data from document-id: 123456 under collection users. You can style the content by adding a class to it by replacing your-class-name.

// If you use: document_name='getFirebaseUid', the document name will be replaced by Firebase UID after user logs in

[realtime class='your-class-name' collection_name='users' document_name='getFirebaseUid' display_fields='firstName,lastName,email,phone,age,gender,food,hobbies' images='imageUrl']

Here is some examples:

Display one image field (Table)

[realtime class='your-class-name' collection_name='users' document_name='-M0k8I5UYw0lxLhG88wU' images='imageUrl']

Display one image field (Blocks)

[realtime class='your-class-name' collection_name='users' document_name='-M0k8I5UYw0lxLhG88wU' images='imageUrl' display_type='blocks']

Display multiple fields (Table)

[realtime class='your-class-name' collection_name='users' document_name='-M0k8I5UYw0lxLhG88wU' display_fields='firstName,lastName,email,phone,age,gender,food,hobbies' images='imageUrl']

Display multiple fields (Blocks)

[realtime class='your-class-name' collection_name='users' document_name='-M0k8I5UYw0lxLhG88wU' display_fields='firstName,lastName,email,phone,age,gender,food,hobbies' images='imageUrl' display_type='blocks']