#
# Object preserved from unsetting after template parsing
# These are meant for referencing
#

lib.stdheader = COA
lib.stdheader {
  stdWrap.wrapAlign.field = header_position
  stdWrap.typolink.parameter.field = header_link
  stdWrap.fieldRequired = header
  stdWrap.editIcons = tt_content : header, [header_layout | header_position], [header_link|date]
  stdWrap.editIcons.beforeLastTag=1
  stdWrap.editIcons.iconTitle=Edit header

  stdWrap.if {
    equals.field = header_layout
    value = 100
    negate = 1
  }

  5 = TEXT
  5.field = date
  5.if.isTrue.field = date
  5.date = d/m Y
  5.wrap = {$content.wrap.headerDate}
  
  10 = CASE
  10.setCurrent {
    field = header
    parseFunc < styles.content.parseFunc
    parseFunc.if.value = 5
    parseFunc.if.equals {
      field = header_layout
      ifEmpty = {$content.defaultHeaderType}
      ifEmpty.override.data = register: defaultHeaderType
    }
    parseFunc.if.negate = 1
  }
  10.key.field = header_layout
  10.key.ifEmpty = {$content.defaultHeaderType}
  10.key.ifEmpty.override.data = register: defaultHeaderType
  10.stdWrap.wrap = {$content.wrap.header}

  10.1 = TEXT
  10.1.current = 1
  10.1.fontTag = {$content.wrap.header1}
  10.1.case = {$content.case.header1}
  10.1.wrap2 = {$content.wrap2.header1}

  10.2 = TEXT
  10.2.current = 1
  10.2.fontTag = {$content.wrap.header2}
  10.2.case = {$content.case.header2}
  10.2.wrap2 = {$content.wrap2.header2}

  10.3 = TEXT
  10.3.current = 1
  10.3.fontTag = {$content.wrap.header3}
  10.3.wrap2 = {$content.wrap2.header3}

  10.4 = TEXT
  10.4.current = 1
  10.4.fontTag = {$content.wrap.header4}

  10.5 < styles.header.gfx1

  stdWrap.space = {$content.headerSpace}
}

# 
# Configuring of language for backwards compatibility
# 
{$comment_DK} config.language = dk



#
# tt_content is started
# 
tt_content >
tt_content = CASE
tt_content.stdWrap {
  spaceBefore.field = spaceBefore
  spaceAfter.field = spaceAfter
  space = {$content.space}
  innerWrap.cObject < styles.content.frames
  innerWrap2 = | {$content.linkToTop}
  innerWrap2.fieldRequired = linkToTop
  dataWrap = <a id="c{field:uid}"></a>
  editPanel = 1
  editPanel {
    allow = move,new,edit,hide,delete
    line=5
    label = %s
    onlyCurrentPid = 1
    previewBorder=4
    edit.displayRecord = 1
  }
}
tt_content.key.field = CType


# CType: header
tt_content.header = COA
tt_content.header {
  10 = < lib.stdheader
  
  20 = CASE
  20.stdWrap.fieldRequired = subheader
  20.stdWrap.parseFunc < styles.content.parseFunc
  20.key.field = layout
  20.stdWrap.wrap = | <br />
  20.stdWrap.editIcons = tt_content:subheader,layout
  20.stdWrap.editIcons.beforeLastTag=1
  20.stdWrap.editIcons.iconTitle=Edit subheader

  20.1 = TEXT
  20.1.field = subheader
  20.1.fontTag = {$content.wrap.subheader1}
  20.2 = TEXT
  20.2.field = subheader
  20.2.fontTag = {$content.wrap.subheader2}
  20.3 = TEXT
  20.3.field = subheader
  20.3.fontTag = {$content.wrap.subheader3}

  20.default < .20.{$content.defaultSubHeaderType}
}




# CType: bullet
tt_content.bullets = COA
tt_content.bullets {
  10 = < lib.stdheader
  20 = CASE
  20.setCurrent.field = bodytext
  20.key.field = layout
  20 {
    default < styles.content.bulletlist_gr
    1 < styles.content.bulletlist

    2 < styles.content.bulletlist_gr
    2.split.1.wrap = <tr><td valign="top">{$content.bulletImages.2}</td><td valign="top"> | </td></tr>

    3 < styles.content.bulletlist_gr
    3.split.1.wrap = <tr><td valign="top">{$content.bulletImages.3}</td><td valign="top"> | </td></tr>
  }

  20.stdWrap.editIcons = tt_content:layout, bodytext [text_align | text_face | text_size | text_color],[text_properties]
  20.stdWrap.editIcons.beforeLastTag=1
  20.stdWrap.editIcons.iconTitle=Edit bulletlist
}




# CType: table
tt_content.table = COA
tt_content.table {
  10 = < lib.stdheader
  20 = CASE
  20.setCurrent.field = bodytext
  20.key.field = layout
  20 {
    default < styles.content.table
    1 < styles.content.table
    1.split.1.split.1.wrap = <td valign="top" bgcolor="{$content.tableCellColor}">|</td>
    1.split.1.split.1.innerWrap = {$content.tableCellWrap}
    1.split.1.split.2.wrap = <td valign="top" bgcolor="{$content.tableCellColor}">|</td>
    1.split.1.split.2.innerWrap = {$content.tableCellWrap}

    2 < styles.content.table
    2.split.1.split.1.wrap = <td valign="top" bgcolor="{$content.tableCellColor}">|</td>
    2.split.1.split.1.innerWrap = {$content.tableCellWrap}
    2.split.2.split.1.wrap = <td valign="top" bgcolor="{$content.tableCellColor}">|</td>
    2.split.2.split.1.innerWrap = {$content.tableCellWrap}

    3 < .1
    3.split.2.split.1.wrap = <td valign="top" bgcolor="{$content.tableCellColor}">|</td>
    3.split.2.split.1.innerWrap = {$content.tableCellWrap}
  }

  20.stdWrap.editIcons = tt_content:layout [cols|table_bgColor|table_border|table_cellspacing|table_cellpadding], bodytext [text_align | text_face | text_size | text_color],[text_properties]
  20.stdWrap.editIcons.beforeLastTag=1
  20.stdWrap.editIcons.iconTitle=Edit table
}



# CType: text
tt_content.text = COA
tt_content.text {
  10 = < lib.stdheader
  20 = TEXT
  20 {
#debugFunc = 2
    fieldRequired = bodytext
    wrap = {$content.wrap.bodytext}
    brTag = {$content.break.bodytext}
    field = bodytext
    textStyle < styles.content.textStyle
    parseFunc < styles.content.parseFunc
    parseFunc.nonTypoTagStdWrap.brTag = {$content.break.bodytext_parseFunc}
    editIcons = tt_content:bodytext [text_align | text_face | text_size | text_color],[text_properties], rte_enabled
    editIcons.beforeLastTag=1
    editIcons.iconTitle=Edit bodytext
  }
  20.parseFunc.tags {
    typolist < tt_content.bullets.20
    typolist.stripNL = 1
    typolist {
        // Overriding values:
      key.field >
      key.data = parameters : type
      setCurrent >
      stdWrap.if.isTrue.current = 1
    }
    typohead < lib.stdheader
    typohead.stripNL = 1
    typohead {
      stdWrap.wrapAlign.field >
      stdWrap.wrapAlign.data = parameters : align
      stdWrap.typolink.parameter.field >
      stdWrap.typolink.parameter.data = parameters : link
      stdWrap.fieldRequired >
      stdWrap.if >
      stdWrap.if.isTrue.current = 1
      stdWrap.wrap = <br /> |
      stdWrap.editIcons >
      10.key.field >
      10.key.data = parameters : type
      10.setCurrent.field >
      10.setCurrent.current = 1
    }
    typocode = TEXT
    typocode.current = 1
    typocode.htmlSpecialChars = 1
    typocode.br = 1
  }
}

# Configures the content for compliancy with the RTE
[globalVar=LIT:0<{$content.RTE_compliant}]
  # Make sure nonTypoTagStdWrap operates on content outside <typolist> and <typohead> only:
  tt_content.text.20.parseFunc.tags {
    typolist.breakoutTypoTagContent = 1
    typohead.breakoutTypoTagContent = 1
    typohead.stdWrap.wrap >
  }

  # Processing <table> and <blockquote> blocks separately
  tt_content.text.20.parseFunc.externalBlocks = table, blockquote
  tt_content.text.20.parseFunc.externalBlocks {
      # The blockquote content is passed into parseFunc again...
    blockquote.callRecursive=1
    blockquote.callRecursive.tagStdWrap.HTMLparser = 1
    blockquote.callRecursive.tagStdWrap.HTMLparser.tags.blockquote.overrideAttribs = style="margin-bottom:0;margin-top:0;"
    blockquote.stripNL=1
    table.stripNL=1
    table.HTMLtableCells=1
    table.HTMLtableCells {
      default.callRecursive=1
      addChr10BetweenParagraphs=1
    }
  }

    # Setting up nonTypoTagStdWrap to wrap the text with P-tags
  tt_content.text.20.parseFunc.nonTypoTagStdWrap >
  tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines < styles.content.RTE_encaps_{$content.RTE_compliant.mode}

    # finally removing the old textstyle formatting on the whole bodytext part.
  tt_content.text.20.textStyle >
  tt_content.text.20.wrap >
  tt_content.text.20.brTag >
[global]



# CType: image
tt_content.image = COA
tt_content.image {
  10 = < lib.stdheader
  20  < styles.content.imgtext
}




# CType: textpic
tt_content.textpic = COA
tt_content.textpic {
  10 = COA  
  10.if.value = 25
  10.if.isLessThan.field = imageorient
  10.10 = < lib.stdheader
    
  20  < styles.content.imgtext
  20.text.10 = COA
  20.text.10 {
    if.value = 24
    if.isGreaterThan.field = imageorient
    10 = < lib.stdheader
  }
  20.text.20 = < tt_content.text.20
}


# CType: rte
tt_content.rte = COA
tt_content.rte {
  10 = < lib.stdheader
  20 = TEXT
  20.field = bodytext

  20.editIcons = tt_content:bodytext
  20.editIcons.beforeLastTag=1
  20.editIcons.iconTitle=Edit Rich Text content
}


# CType: uploads
tt_content.uploads = COA
tt_content.uploads {
  10 = < lib.stdheader
  20 = CASE
  20 {
    setCurrent.field = media
    key.field = layout
    default < styles.content.uploads
    1 < styles.content.uploads_icons
    2 < styles.content.uploads_imgicons
    3 < styles.content.uploads_imgicons
    3.split.1.filelink.icon.wrap >
  }

  20.stdWrap.editIcons = tt_content:media, layout [table_bgColor|table_border|table_cellspacing|table_cellpadding],filelink_size,imagecaption
  20.stdWrap.editIcons.iconTitle=Edit filelist
}




# CType: menu
tt_content.menu = COA
tt_content.menu {
  10 = < lib.stdheader
  20 = CASE
  20 {
    key.field = menu_type

    default = HMENU
    default {
      special = list
      special.value.field = pages
      1 = TMENU
      1.NO.linkWrap =  {$content.menuWrap}
      1.NO.allWrap = {$content.menuAllWrap}
      1.NO.ATagBeforeWrap = {$content.menuATagBeforeWrap}
      1.target = {$content.pageFrameObj}
    }

    1 < .default
    1.special = directory

    2 < styles.sitemap.text

    3 < styles.insertContent
    3.select.andWhere = sectionIndex!=0
    3.select.pidInList.override.field = pages
    3.renderObj = TEXT
    3.renderObj {
      fieldRequired = header
      trim=1
      field = header
      wrap = {$content.menuWrap}
      typolink.parameter.field = pid
      typolink.section.field = uid
      wrap2 = |<br />
    }

    4 < .1
    4.1.NO {
      after.data = field : abstract // field : description // field : subtitle
      after.htmlSpecialChars = 1
      afterWrap = <br />{$content.subMenuWrap}
    }

    5 < .default
    5.special = updated
    5.special {
      maxAge = 3600*24*7
      excludeNoSearchPages = 1
    }

    6 < .default
    6.special = keywords
    6.special {
      excludeNoSearchPages = 1
    }

    7 < .1
    7.1.expAll = 1
    7.1.wrap = |<br />
    7.2 < .7.1
    7.2.sectionIndex = 1
    7.2.sectionIndex.type = header
    7.2.NO.linkWrap =  {$content.subMenuWrap}
  }

  20.stdWrap.editIcons = tt_content: menu_type,pages
  20.stdWrap.editIcons.iconTitle=Edit linkmenu
}




# CType: shortcut
tt_content.shortcut = COA
tt_content.shortcut {
#  10 = < lib.stdheader
  20 = CASE
  20.key.field = layout
  20.0= RECORDS
  20.0 {
    source.field = records
    tables = {$content.shortcut.tables}
  }
  20.1= RECORDS
  20.1 {
    source.field = records
    tables = {$content.shortcut.tables}
  }

  20.stdWrap.editIcons = tt_content: records
  20.stdWrap.editIcons.iconTitle=Edit recordlist
}




# CType: list
# The keys for the CASE-cObject is supplied by including static_templates which is configured to fill out these positions. Examples are "content.tt_products" and "content.tt_calendar"
tt_content.list = COA
tt_content.list.10 = < lib.stdheader
tt_content.list.20 = CASE
tt_content.list.20.key.field = list_type
tt_content.list {
  20.stdWrap.editIcons = tt_content: list_type, layout, select_key, pages [recursive]
  20.stdWrap.editIcons.iconTitle=Edit recordlist
}


# CType: multimedia
tt_content.multimedia = COA
tt_content.multimedia {
  10 = < lib.stdheader
  20 = MULTIMEDIA
  20.file.field = multimedia
  20.file.wrap = uploads/media/
  20.file.listNum = 0
  20.params.field = bodytext
}




# CType: splash
tt_content.splash = CASE
tt_content.splash.key.field = splash_layout

tt_content.splash.default = COA
tt_content.splash.default {
  20 = CTABLE
  20 {
    c.1 = < tt_content.text
    lm.1 = IMAGE
    lm.1.file {
      import = uploads/pics/
      import.field = image
      import.listNum = 0
      maxW.field = imagewidth
      maxW.ifEmpty = 200
    }
    cMargins = 30,0,0,0
  }
}
tt_content.splash.1 < tt_content.splash.default
tt_content.splash.1.20.lm.1.file >
tt_content.splash.1.20.lm.1.file = GIFBUILDER
tt_content.splash.1.20.lm.1.file {
  XY = [10.w]+10,[10.h]+10
  backColor = {$content.splash.bgCol}
  backColor.override.data = register:pageColor
  format = jpg
  5 = BOX
  5.dimensions = 3,3,[10.w],[10.h]
  5.color = #333333
  7 = EFFECT
  7.value = blur=99|blur=99|blur=99|blur=99|blur=99|blur=99|blur=99
  10 = IMAGE
  10.file {
    import = uploads/pics/
    import.field = image
    import.listNum = 0
    maxW.field = imagewidth
    maxW.ifEmpty = 200
  }
}
tt_content.splash.2 < tt_content.splash.default
tt_content.splash.2.20.lm.1.file.m < styles.content.imgFrames.1
tt_content.splash.3 < tt_content.splash.default
tt_content.splash.3.20.lm.1.file.m < styles.content.imgFrames.2
  // From plugin.postit1, if included:
tt_content.splash.20 = < plugin.postit1

# CType: mailform
tt_content.mailform = COA
tt_content.mailform {
  10 = < lib.stdheader
  20 < styles.content.mailform

  20.stdWrap.editIcons = tt_content: bodytext,pages,subheader
  20.stdWrap.editIcons.iconTitle=Edit multimedia element
}




# CType: search
tt_content.search = COA
tt_content.search {
  10 = < lib.stdheader
  20 < styles.content.searchresult
  30 < styles.content.searchform

  30.stdWrap.editIcons = tt_content: pages
  30.stdWrap.editIcons.iconTitle=Edit search element
}




# CType: login
tt_content.login = COA
tt_content.login {
  10 = < lib.stdheader
  20 < styles.content.loginform

  20.stdWrap.editIcons = tt_content: pages
  20.stdWrap.editIcons.iconTitle=Edit login element
}




# CType: html
tt_content.html = TEXT
tt_content.html.field = bodytext
tt_content.html.editIcons = tt_content: pages
tt_content.html.editIcons.iconTitle=Edit pure HTML content

# CType: script
tt_content.script = TEXT
tt_content.script.value =

# CType: script
tt_content.div = TEXT
tt_content.div.value =

# Default error msg:
tt_content.default = TEXT
tt_content.default.field = CType
tt_content.default.wrap = <b>CTYPE "|" not defined! </b>


