I am using MOSS Publishing Pages. I want to dynamically create a header for sections if they are populated. This particular page layout has some fields that are required and they have static headers. I have a PublishingHTML section that is not required called Customer Feedback and one for additional links using SummaryLinks. If there is no Customer Feedback I want the heading hidden. I cannot use codeblock's in this site. I am hoping to use JQuery but so far have not had any luck.
Used Ashish's example for the summary links. I still have the issue with the PublishingRichHTML. Instead of hiding persay, I am adding the header instead or at least thats what I have working partially.
$.each(["CustomerFeedback"],
function (index, value) {
if ($("div[id*='_" + value +
"__ControlWrapper_RichHtmlField']").children()
.length > 0)
{
$("div.CFHeader").html('Customer Feedback');
}
});
The problem is that if you just start typing in this the field and do not do any returns or formatting then no child tags are created. If you copy and paste or put in line breaks SharePoint automatically adds the tags at which point it works.