I'm trying to display content based on whether a property exists or not. The problem is that the direct parent is named depending on the link the user clicks. Example:
if (content.aPage.data){
//show some content
}
else {
//show other content
}
in the example above the "aPage" property could be named "bPage", "cPage" etc... some of these pages have the 'data' prop, some don't. It doesn't make sense for me to write a switch or if statements for all of the pages that don't have the 'data' prop because there are too many. Is there another way to do this?