# Setting up the main template

temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template = FILE
  template.file = {$page.file.template} 
}


# Setting up Level 1 menu, based on template!

temp.L1menu = HMENU
temp.L1menu.1 = TMENU
temp.L1menu.1.NO {
  before.cObject < temp.mainTemplate
  before.cObject {
    workOnSubpart = SUB_MENU_ITEM
    marks.MENU_TITLE = TEXT
    marks.MENU_TITLE.field = title
    wraps.LINK = TEXT
    wraps.LINK {
      value = |
      typolink.parameter.field = uid
    }
  }
  doNotShowLink = 1
}
temp.L1menu.1.ACT < temp.L1menu.1.NO
temp.L1menu.1.ACT = 1
temp.L1menu.1.ACT.before.cObject.workOnSubpart = SUB_MENU_ITEM_ACT


# Setting up Level 2 menu, based on template!

temp.L2menuItems = HMENU
temp.L2menuItems.entryLevel = 1
temp.L2menuItems.1 = TMENU
temp.L2menuItems.1.NO {
  before.cObject < temp.mainTemplate
  before.cObject {
    workOnSubpart = SUB_L2MENU_ITEM
    marks.MENU_TITLE = TEXT
    marks.MENU_TITLE.field = title
    wraps.LINK = TEXT
    wraps.LINK {
      value = |
      typolink.parameter.field = uid
    }
  }
  doNotShowLink = 1
}
temp.L2menuItems.1.ACT < temp.L2menuItems.1.NO
temp.L2menuItems.1.ACT = 1
temp.L2menuItems.1.ACT.before.cObject.workOnSubpart = SUB_L2MENU_ITEM_ACT

temp.L2menu < temp.mainTemplate
temp.L2menu {
  
  workOnSubpart = SUB_L2MENU
  subparts.SUB_L2MENU_ALLITEMS < temp.L2menuItems
}




# Page object

page = PAGE
page.typeNum = 0
page.bodyTag < styles.content.bodyTag
page.bodyTagMargins=0
page.headerData.20 < temp.mainTemplate
page.headerData.20 {
  workOnSubpart = HEADER_DATA
}



page.10  < temp.mainTemplate
page.10 {
  workOnSubpart = DOCUMENT_BODY
  subparts.SUB_CONTENT = COA
  subparts.SUB_CONTENT {
    5 < styles.content.editPanelPage
    10 < styles.content.get
    30 < styles.content.lastUpdate
    40 < styles.content.typo3_powered
  }
  subparts.SUB_CONTENT_MARGIN = COA
  subparts.SUB_CONTENT_MARGIN {
    5 < temp.L2menu
    10 = LOAD_REGISTER
    10.defaultHeaderType = 2
    10.maxImageWidth = 150
    20 < styles.content.getBorder
    30 = RESTORE_REGISTER
  }
  subparts.SUB_MENU < temp.L1menu
}



lib.stdheader.stdWrap >
lib.stdheader.10.1 >
lib.stdheader.10.1  < temp.mainTemplate
lib.stdheader.10.1 {
  workOnSubpart = SUB_HEADER1
  marks.MARK_HEADER = TEXT
  marks.MARK_HEADER.field = header
}
lib.stdheader.10.2 >
lib.stdheader.10.2 < lib.stdheader.10.1
lib.stdheader.10.2.workOnSubpart = SUB_HEADER2
lib.stdheader.10.stdWrap.wrap >


tt_content.menu.20.1 >
tt_content.menu.20.1 < temp.L2menu
tt_content.menu.20.1.subparts.SUB_L2MENU_ALLITEMS {
  special = directory
  special.value.field = pages
}



# Configuration

config.extTarget = _blank
config.compensateFieldWidth = 0.7


page.config.admPanel = 1
config.intTarget = {$PAGE_TARGET}
page.headerData.999 < plugin.meta

