Source: site.view [edit]
Function name: insertDynamicContent
Arguments: pos
Description:
Page type: webl
Render function:  
Module: jw

Page source:

var fi = Wub_GetFunctionInfo("jw.publishedContent");
var content = WubEval(fi.exec);
var html = "";

var insertPara = false;

every rec in content do
   var hasUrl = false;
   var hasItalics = false;
   if rec.pos == pos then
      if rec.type == "heading" then
         if (insertPara) then
            html = html + "<p>"
         else
            insertPara = true;
         end;
         html = html + `<li id="res1">`
      elsif rec.type == "subheading" then
         html = html + `<li id="res2"><i>`;
         hasItalics = true;
      elsif rec.type == "article" then
         html = html + `<li id="res4">`;
         if Str_Trim(rec.url) != "" then
            html = html + `<a target="_blank" href="` + rec.url + `">`;
            hasUrl = true;
         end
      end;
      html = html + rec.title;
      if hasItalics then
         html = html + "</i>"
      end;
      if hasUrl then
         html = html + "</a>"
      end;
      html = html + "</li>\n"
   end
end;

html;