// Force dynamic for the TAG ID filters
request.element.isStatic = 0;
posts = attributes.elementInfo.elementData.propertyValues;
// Added check to validate that the metadata form field exists.
if ( NOT StructKeyExists(request.page, "metadata")
OR NOT StructKeyExists(request.page.metadata, "blogs2")
OR NOT StructKeyExists(request.page.metadata.blogs2, "blogID") ){
request.page.metadata.blogs2.blogID = "0";
}
// Get Blog data for the
blogData = application.ptBlog2.blogDAO.getBlog(request.page.metadata.blogs2.blogID);
// Check if the TAGS ID filter is passed over the URL
// Set a flag to determine if we run the tag check
if ( StructKeyExists(request.params, "tagID") AND LEN(request.params.tagID) ){
// Filter the posts based on the tag ID
posts = application.ptBlog2.postService.filterPostsDataByTagID(postDataArray=posts, tagID=request.params.tagID);
}
displayRSSOptions = false;
// Check if we want to display the RSS options
if ( StructKeyExists(blogData, "rssFeed") AND (blogData.rssFeed EQ true) )
displayRSSOptions = true;
// Get the comments for the posts
commentCount = application.ptBlog2.cedata.getCountForElementField(ceName="Comments2", fieldName="postID", fieldValue=posts[itm].values.postID);
// Check if comments are allowed
if ( posts[itm].values.allowComments EQ 1 )
renderComments = true;
else
renderComments = false;