This shortcode will help to retrieve document data from the Firestore 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 firestore data basing on collection name & document id. Display fields are required in order to show items // Show item as table [firestore 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 [firestore 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 [firestore 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)
[firestore class='your-class-name' collection_name='users' document_name='o9qHiFliNmW1sxbAcmWK' images='imageUrl']
Display one image field (Blocks)
[firestore class='your-class-name' collection_name='users' document_name='o9qHiFliNmW1sxbAcmWK' images='imageUrl' display_type='blocks']
Display multiple fields (Table)
[firestore class='your-class-name' collection_name='users' document_name='o9qHiFliNmW1sxbAcmWK' display_fields='firstName,lastName,email,phone,age,gender,food,hobbies' images='imageUrl']
Display multiple fields (Blocks)
[firestore class='your-class-name' collection_name='users' document_name='o9qHiFliNmW1sxbAcmWK' display_fields='firstName,lastName,email,phone,age,gender,food,hobbies' images='imageUrl' display_type='blocks']