  # Clear out any constants in this reserved room!
styles.content >

  # get content
styles.content.get = CONTENT
styles.content.get {
  table = tt_content
  select.orderBy = sorting
  select.where = colPos=0
  select.languageField = sys_language_uid
}

  # get content, left
styles.content.getLeft < styles.content.get
styles.content.getLeft.select.where = colPos=1

  # get content, right
styles.content.getRight < styles.content.get
styles.content.getRight.select.where = colPos=2

  # get content, margin
styles.content.getBorder < styles.content.get
styles.content.getBorder.select.where = colPos=3

  # get news
styles.content.getNews < styles.content.get
styles.content.getNews.select.pidInList = {$styles.content.getNews.newsPid}

  # parsefunc - good old...
styles.content.parseFunc {
  makelinks = 1
  makelinks.http.keep = {$styles.content.links.keep}
  makelinks.http.extTarget = {$styles.content.links.extTarget}
  makelinks.mailto.keep = path
  tags {
    link = TEXT
    link {
      current = 1
      typolink.parameter.data = parameters : allParams
      typolink.extTarget = {$styles.content.links.extTarget}
      typolink.target = {$styles.content.links.target}
      parseFunc.constants =1
    }
  }
  allowTags = {$styles.content.links.allowTags}
  denyTags = *
  sword = {$styles.content.links.sword}
  constants = 1
}

# Edit page object:
styles.content.editPanelPage = COA
styles.content.editPanelPage {
  10 = EDITPANEL
  10 {
    allow = toolbar,move,hide
    label = Page: <B>%s</B>
  }
}















#
# "lib." objects are preserved from unsetting after template parsing
#


# ParseFunc configured particularly for RTE using fields, including bodytext.
lib.parseFunc_RTE < styles.content.parseFunc
lib.parseFunc_RTE {
//  makelinks >
  # Processing <table> and <blockquote> blocks separately
  externalBlocks = table, blockquote, ol,ul
  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
    ol.stripNL=1
	ol.stdWrap.parseFunc < styles.content.parseFunc
    ul.stripNL=1
	ul.stdWrap.parseFunc < styles.content.parseFunc
    table.stripNL=1
    table.stdWrap.HTMLparser = 1
    table.stdWrap.HTMLparser.tags.table.fixAttrib.class {
	  default = contenttable
      always = 1
	  list = contenttable
	}
	table.stdWrap.HTMLparser.keepNonMatchedTags = 1
    table.HTMLtableCells=1
    table.HTMLtableCells {
      default.callRecursive=1
      addChr10BetweenParagraphs=1
    }
  } 
  nonTypoTagStdWrap.encapsLines {
    encapsTagList = div,p,pre,h1,h2,h3,h4,h5,h6
    remapTag.DIV = P
    nonWrappedTag = P
    innerStdWrap_all.ifEmpty = &nbsp;
	addAttributes.P.class = bodytext
	addAttributes.P.class.setOnly=blank
  }  
}


# Content header:
lib.stdheader {
  5.date = d/m Y
  
    # This CASE cObject renders the header content:
	# currentValue is set to the header data, possibly wrapped in link-tags.
  10 = CASE
  10.key.field = header_layout
  10.key.ifEmpty = {$content.defaultHeaderType}
  10.key.ifEmpty.override.data = register: defaultHeaderType

  10.1 = TEXT
  10.1.current = 1
  10.1.fontTag = <H1>|</H1>

  10.2 = TEXT
  10.2.current = 1
  10.2.fontTag = <H2>|</H2>

  10.3 = TEXT
  10.3.current = 1
  10.3.fontTag = <H3>|</H3>

  10.4 = TEXT
  10.4.current = 1
  10.4.fontTag = <H4>|</H4>

  10.5 = TEXT
  10.5.current = 1
  10.5.fontTag = <H5>|</H5>
}







#
# tt_content is started
# 
# Includes the extension class and sets up the content rendering 
# to be done with the class in this extension:
includeLibs.tx_cssstyledcontent_pi1 = EXT:css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
tt_content >
tt_content = USER
tt_content.userFunc = tx_cssstyledcontent_pi1->main
tt_content.noANameTagForFirstRecord = 0

# *****************
# CType: header
# *****************
#.....


# *****************
# CType: text
# *****************
# Only "20.parseFunc" is used here. "tt_content.text" is no longer a TEXT cObject!
# Copying lib.parseFunc_RTE is important to do in order to keep backwards compatibility.
tt_content.text.20.parseFunc < lib.parseFunc_RTE


# *****************
# CType: image
# *****************
# This (tt_content.image) is an IMGTEXT cObject 
# (also used for rendering 'textpic' type):
tt_content.image {
  imgList.field = image
  textPos.field = imageorient
  imgPath = uploads/pics/
  imgObjNum = 1
  1 {
     file.import.current = 1
     file.width.field = imagewidth
     params = align="top"
     imageLinkWrap = 1
     imageLinkWrap {
       bodyTag = <BODY bgColor=black>
       wrap = <A href="javascript:close();"> | </A>
       width = {$styles.content.imgtext.linkWrap.width}
       height = {$styles.content.imgtext.linkWrap.height}
       effects = {$styles.content.imgtext.linkWrap.effects}
       JSwindow = 1
       JSwindow.newWindow = {$styles.content.imgtext.linkWrap.newWindow}
       JSwindow.expand = 17,20
       enable.field = image_zoom
       enable.ifEmpty.field = image_link
       typolink.parameter.field = image_link
       typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM
       typolink.target = {$styles.content.links.target}
       typolink.extTarget = {$styles.content.links.extTarget}
     }
  }
  maxW = {$styles.content.imgtext.maxW}
  maxW.override.data = register:maxImageWidth
  maxWInText = {$styles.content.imgtext.maxWInText}
  equalH.field = imageheight
  spaceBelowAbove = 6
  noRows.field = image_noRows

  cols.field = imagecols
  border.field = imageborder
  caption {
    1 = TEXT
    1.if.isFalse = {$styles.content.imgtext.captionSplit}
    1.field = imagecaption
    1.parseFunc < styles.content.parseFunc
    1.required = 1
    1.fontTag = <P class="csc-caption">|</span>
    1.wrapAlign.field = imagecaption_position
    1.wrap = | <BR>
    1.spaceBefore = 5
    1.br = 1
  }
  captionSplit = {$styles.content.imgtext.captionSplit}
  captionSplit.cObject = TEXT
  captionSplit.cObject.field = imagecaption
  captionSplit.stdWrap < .caption.1
  captionSplit.stdWrap {
    field >
    if >
  }

  borderCol = {$styles.content.imgtext.borderColor}
  borderThick = {$styles.content.imgtext.borderThick}
  colSpace = {$styles.content.imgtext.colSpace}
  rowSpace = {$styles.content.imgtext.rowSpace}
  textMargin = {$styles.content.imgtext.textMargin}

  editIcons = tt_content : image [imageorient|imagewidth|imageheight], [imagecols|image_noRows|imageborder],[image_link|image_zoom],imagecaption[imagecaption_position]
  editIcons.iconTitle=Edit images
  caption.editIcons = tt_content : imagecaption[imagecaption_position]
  caption.editIcons.beforeLastTag=1
  caption.editIcons.iconTitle = Edit image caption
}

# *****************
# CType: textpic
# *****************
# This is handled 100% inside the PHP class based on the TS config of "text" and "image"


# *****************
# CType: bullet
# *****************
# Handled 100% inside the PHP class


# *****************
# CType: table
# *****************
# Handled 100% inside the PHP class


# *****************
# CType: uploads
# *****************
# ...


# ****************
# CType: menu
# ****************
# This truely IS a content object, launched from inside the PHP class of course.
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.allWrap = <P>|</P>
      1.target = {$content.pageFrameObj}
	  1.wrap = <DIV class="csc-menu">|</DIV>
    }

    1 < .default
    1.special = directory

    2 < styles.sitemap.text

    3 < styles.content.get
	3.wrap = <DIV class="csc-menu"></DIV>
    3.select.andWhere = sectionIndex!=0
    3.select.pidInList.override.field = pages
    3.renderObj = TEXT
    3.renderObj {
      fieldRequired = header
      trim=1
      field = header
      wrap = <P>|</P>
      typolink.parameter.field = pid
      typolink.section.field = uid
    }

    4 < .1
    4.1.NO {
      after.data = field : abstract // field : description // field : subtitle
      after.htmlSpecialChars = 1
      afterWrap = <P class="csc-menu">|</P>
    }

    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.allWrap = <P class="csc-section">|</P>
  }

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


# ****************
# CType: shortcut
# ****************
# This truely IS a content object, launched from inside the PHP class of course.
# Should be a complete copy from the old static template "content (default)"
tt_content.shortcut = COA
tt_content.shortcut {
  20 = CASE
  20.key.field = layout
  20.0= RECORDS
  20.0 {
    source.field = records
    tables = {$content.shortcut.tables}
      # THESE are OLD plugins. Modern plugins registers themselves automatically!
    conf.tt_content = < tt_content
    conf.tt_address = < tt_address
    conf.tt_links = < tt_links
    conf.tt_guest = < tt_guest
    conf.tt_board = < tt_board
    conf.tt_calender = < tt_calender
    conf.tt_rating < tt_rating
    conf.tt_products = < tt_products
    conf.tt_news = < tt_news
    conf.tt_poll = < plugin.tt_poll
  }
  20.1= RECORDS
  20.1 {
    source.field = records
    tables = {$content.shortcut.tables}
    conf.tt_poll = < plugin.tt_poll
    conf.tt_poll.code = RESULT,SUBMITTEDVOTE
  }

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


# ****************
# CType: list
# ****************
# This truely IS a content object, launched from inside the PHP class of course.
# Should be a complete copy from the old static template "content (default)"
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 {
  # LIST element references (NOT copy of objects!)
  # THESE are OLD plugins. Modern plugins registers themselves automatically!
  3 = CASE
  3.key.field = layout
  3.0 = < plugin.tt_guest

  4 = CASE
  4.key.field = layout
  4.0 = < plugin.tt_board_list
  4.1 = < plugin.tt_board_tree

  2 = CASE
  2.key.field = layout
  2.0 = < plugin.tt_board_tree

  5 = CASE
  5.key.field = layout
  5.0 = < plugin.tt_products

  7 = CASE
  7.key.field = layout
  7.0 = < plugin.tt_calender

  8 = CASE
  8.key.field = layout
  8.0 = < plugin.tt_rating

  9 = CASE
  9.key.field = layout
  9.0 = < plugin.tt_news

  11 = CASE
  11.key.field = layout
  11.0 = < plugin.tipafriend

  20 = CASE
  20.key.field = layout
  20.0 = < plugin.feadmin.fe_users

  21 = CASE
  21.key.field = layout
  21.0 = < plugin.feadmin.dmailsubscription
}
tt_content.list {
  20.stdWrap.editIcons = tt_content: list_type, layout, select_key, pages [recursive]
  20.stdWrap.editIcons.iconTitle=Edit recordlist
}



# ******************
# CType: multimedia
# ******************
# This truely IS a content object, launched from inside the PHP class of course.
# Should be a complete copy from the old static template "content (default)"
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: html
# ****************
# This truely IS a content object, launched from inside the PHP class of course.
# Should be a complete copy from the old static template "content (default)"
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
# ****************
# OBSOLETE! Please make extensions instead. The "script" content element was meant for these custom purposes in the past. Today extensions will do the job better.
tt_content.script = TEXT
tt_content.script.value =

# ****************
# CType: div
# ****************
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>













