
lib.contentElement {
	layoutRootPaths.1000 = EXT:bgm_theme_azh/Resources/Private/Templates/FluidContent/Layouts/
	partialRootPaths.1000 = EXT:bgm_theme_azh/Resources/Private/Templates/FluidContent/Partials/
	templateRootPaths.1000 = EXT:bgm_theme_azh/Resources/Private/Templates/FluidContent/Templates/

	settings {
		contactPage = {$bgm_theme.pageUids.kontakt}

		sourceCollection {
			desktop-s {
				mediaQuery = (min-width: 1280px)
				width = 520
				height >
			}

			mobile-xl {
				mediaQuery = (min-width: 1024px)
				width = 608
				height >
			}

			mobile-l {
				mediaQuery = (min-width: 768px)
				width = 457
				height >
			}

			mobile-m {
				mediaQuery = (min-width: 600px)
				width = 411
				height >
			}
		}
	}

	variables{
		pid = TEXT
		pid.data = TSFE:id

		pageLayout = TEXT
		pageLayout.data = levelfield:-1,backend_layout_next_level,slide
		pageLayout.override.data = page:backend_layout
	}
}

tt_content.gallery < tt_content.textmedia
tt_content.gallery {
	templateName = Gallery
	dataProcessing.20 >
}

tt_content.producttile < tt_content.gallery
tt_content.producttile.templateName = Producttile

tt_content.fitsto < tt_content.div
tt_content.fitsto {
	templateName = Fitsto
}

tt_content.youtubevideo < tt_content.gallery
tt_content.youtubevideo {
	templateName = Youtubevideo
	dataProcessing.20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
	dataProcessing.20 {
		references {
			table = tt_content
			fieldName = media
		}
		as = portraitvideo
	}
}

tt_content.textmedia {
	dataProcessing.30 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
	dataProcessing.30 {
		references {
			table = tt_content
			fieldName = media
		}
		as = portraitvideo
	}
}

tt_content.contact < tt_content.textmedia
tt_content.contact.templateName = Contact

//Spezielle Bild-Größen auf der Kontakt-Seite
#[globalVar = TSFE:id={$bgm_theme.pageUids.contact}]
[getTSFE().id == {$bgm_theme.pageUids.kontakt}]

lib.fluidContent{
	settings {
		sourceCollection {
			desktop-s {
				mediaQuery = (min-width: 1280px)
				width = 520
				height >
			}

			mobile-xl {
				mediaQuery = (min-width: 1024px)
				width = 608
				height >
			}

			mobile-l {
				mediaQuery = (min-width: 768px)
				width = 457
				height >
			}

			mobile-m {
				mediaQuery = (min-width: 600px)
				width = 411
				height >
			}
		}
	}
}
[global]
#Subscribe to azh-nL on vsa.de
tt_content.nlheimi < tt_content.textmedia
tt_content.nlheimi.templateName = NewsletterHeimi

lib.parseFunc.tags.link.typolink.ATagParams.append = COA
lib.parseFunc.tags.link.typolink.ATagParams.append  {
	stdWrap {
		wrap = data-parent="|"
		insertData = 1
	}

	10 = TEXT
	10.value = {page:uid}

	20 = TEXT
	20 {
		value = {TSFE:currentRecord}
		if.isTrue.data = TSFE:currentRecord
		wrap = -|
	}

	30 = TEXT
	30 {
		value = {page:uid}
		if.isFalse.data = TSFE:currentRecord
		wrap = -pages:|
	}
}
lib.parseFunc.tags.a.typolink.ATagParams.append < lib.parseFunc.tags.link.typolink.ATagParams.append
lib.parseFunc_RTE.tags.link.typolink.ATagParams.append < lib.parseFunc.tags.link.typolink.ATagParams.append
lib.parseFunc_RTE.tags.a.typolink.ATagParams.append < lib.parseFunc.tags.link.typolink.ATagParams.append

temp.ce_azhanimation < tt_content.textmedia
temp.ce_azhanimation {
	templateName = Animationen
}
tt_content.azhanimation_uhr < temp.ce_azhanimation
tt_content.azhanimation_uhr {
	settings {
		animation = uhr
	}
}
tt_content.azhanimation_transfer < temp.ce_azhanimation
tt_content.azhanimation_transfer {
	settings {
		animation = transfer
	}
}
tt_content.azhanimation_akten < temp.ce_azhanimation
tt_content.azhanimation_transfer {
	settings {
		animation = transfer
	}
}
tt_content.azhanimation_akten < temp.ce_azhanimation
tt_content.azhanimation_akten {
	settings {
		animation = akten
	}
}
tt_content.azhanimation_geld < temp.ce_azhanimation
tt_content.azhanimation_geld {
	settings {
		animation = geld
	}
}
tt_content.azhanimation_buero < temp.ce_azhanimation
tt_content.azhanimation_buero {
	settings {
		animation = buero
	}
}



lib.categoryTitleAsClassname = CONTENT
lib.categoryTitleAsClassname {
table = sys_category
select {
  pidInList = 95
  recursive = 99
  selectFields = sys_category.title
  join = sys_category_record_mm on sys_category_record_mm.uid_local = sys_category.uid
  where.field = recordUid
  where.wrap = sys_category_record_mm.tablenames = 'tt_content' and sys_category_record_mm.uid_foreign='|'
}
renderObj = COA
renderObj {
  1 = TEXT
  1 {
    field = title
    stdWrap.noTrimWrap = | Kategorie-||
    stdWrap.replacement {
        10 {
          search.char= 32
          replace =
        }
        20 {
          search = /
          replace = -
        }
        40 {
          search = ü
          replace = ue
        }
        50 {
          search = ö
          replace = oe
        }
        60 {
          search = ä
          replace = ae
        }
      }
    }
  }
}

lib.categoryTitleAsClassnameFromPages < lib.categoryTitleAsClassname
lib.categoryTitleAsClassnameFromPages {
  select {
    where.wrap = sys_category_record_mm.tablenames = 'pages' and sys_category_record_mm.uid_foreign='|'
  }
}


lib.categoryTitleAsOption < lib.categoryTitleAsClassname
lib.categoryTitleAsOption {
  select {
    where.wrap = sys_category_record_mm.tablenames = 'tt_content' and sys_category_record_mm.uid_foreign='|' AND (sys_category.title !='KeineKategorie' OR sys_category.uid !=42)
  }
  renderObj {
    1 = TEXT
    1 {
      field = title
      stdWrap.noTrimWrap >
      stdWrap.wrap = |,
      stdWrap.replacement >
    }
  }
}

lib.cookieRedirectContentFiltered < lib.categoryTitleAsClassname
lib.cookieRedirectContentFiltered {
  select {
    where.wrap = sys_category_record_mm.tablenames = 'tt_content' and sys_category_record_mm.uid_foreign='|'
  }
  renderObj {
    1 = TEXT
    1 {
      field = title
      stdWrap.noTrimWrap >
      stdWrap.wrap = |,
      stdWrap.replacement >
    }
  }
}

lib.textnoUmlaut = TEXT
lib.textnoUmlaut {
  field = text
  stdWrap.replacement {
    10 {
      search.char= 32
      replace =
    }
    20 {
      search = /
      replace = -
    }
    40 {
      search = ü
      replace = ue
    }
    50 {
      search = ö
      replace = oe
    }
    60 {
      search = ä
      replace = ae
    }
  }
}
lib.sanitisedAnchor = TEXT
lib.sanitisedAnchor {
  field = text
  case = lower
  stdWrap.replacement {
    10 {
      search.char= 32
      replace = 0000
    }
    20 {
      search = /
      replace = -
    }
    40 {
      search = ü
      replace = ue
    }
    50 {
      search = ö
      replace = oe
    }
    60 {
      search = ä
      replace = ae
    }
    5 {
      search = /[^a-zA-Z0-9 ]/
      replace =
      useRegExp = 1
    }
    80 {
      search = 0000
      replace = -
    }
    90 {
      search = ----
      replace = -
    }
    100 {
      search = --
      replace = -
    }
  }
}


#lib.sanitisedAnchor >
#lib.sanitisedAnchor = TEXT
#lib.sanitisedAnchor.value = TEST




tt_content.filterbox < tt_content.gallery
tt_content.filterbox.templateName = Filterbox

tt_content.filterboxservice < tt_content.gallery
tt_content.filterboxservice.templateName = FilterboxService

tt_content.becomeacustomer < lib.contentElement
tt_content.becomeacustomer {
	#10 = FLUIDTEMPLATE
	#10 {
	#	file = EXT:bgm_theme_azh/Resources/Private/Templates/FluidContent/Templates/BoxBecomeACustomer.html
	#}
	dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
	dataProcessing.10 {
		references {
			table = tt_content
			fieldName = assets
		}
		as = file
	}
	dataProcessing.20 = BGM\BgmThemeAzh\DataProcessing\FlexFormProcessor
	dataProcessing.20 {
		fieldName = pi_flexform
		as = flexform
	}
}
tt_content.becomeacustomer.templateName = BoxBecomeACustomer


tt_content {
  menu =< lib.contentElement
  menu {
    templateName = Menu
    dataProcessing {
      #10 = TYPO3\CMS\Frontend\DataProcessing\SplitProcessor
      #10 {
      #  if.isTrue.field = pages
      #  fieldName = pages
      #  delimiter = ,
      #  removeEmptyEntries = 1
      #  filterIntegers = 1
      #  filterUnique = 1
      #  as = pageUids
      #}
      20 < .10
      20 {
        if.isTrue.field = selected_categories
        fieldName = selected_categories
        as = categoryUids
      }
      10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
      10 {
        special = directory
        special.value.field = pages
        dataProcessing {
          10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
          10 {
            references.fieldName = media
            as = media
          }
        }
      }
      30 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
      30 {
        special = list
        special.value.field = pages
        as = menulist
        dataProcessing {
          10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
          10 {
            references.fieldName = media
            as = media
          }
        }
      }

    }
    stdWrap {
      # Setup the edit icon for content element "menu"
      editIcons = tt_content: header [header_layout], menu_type, pages
      editIcons {
        iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.menu
      }
    }
  }
}



tt_content.menu_producttiles < tt_content.menu_subpages
tt_content.menu_producttiles {
  templateName = Menuproducttiles
  dataProcessing {
    10 >
    10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
    10 {
      special = list
      special.value.field = pages
      as = menulist
      dataProcessing {
        10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
        10 {
          references.fieldName = media
          as = media
        }
      }
    }
  }
}


tt_content.menu_sitemap_pages.dataProcessing{
  #10 >
  #10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
  10 {
    #special = list
    #special.value.field = pages
    #levels = 7
    expandAll = 1
    includeNotInMenu = 1
    #dataProcessing {
    #  10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    #  10 {
    #    references.fieldName = media
    #  }
    #}
  }
}

#add &nbsp; to empty tags
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.innerStdWrap_all.ifEmpty = &nbsp;

tt_content {
	customerfeedback < lib.contentElement
	customerfeedback {
		templateName = CustomerFeedbackSlide
		dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
		dataProcessing.10 {
			references {
				table = tt_content
				fieldName = assets
			}
			as = images
		}
	}
}


lib.categorySelectionForFixedLayerOptions = CONTENT
lib.categorySelectionForFixedLayerOptions {
  table = sys_category
  select {
    pidInList = 95
    recursive = 99
    selectFields = sys_category.title, sys_category.uid
    join = sys_category_record_mm on sys_category_record_mm.uid_local = sys_category.uid
    #where.field = recordUid
    #where.wrap = sys_category_record_mm.tablenames = 'tt_content' and sys_category.parent=14
    where = sys_category.parent=14 AND sys_category.uid !=42
    orderBy = sys_category.title
    groupBy = sys_category.title
  }
  renderObj = COA
  renderObj {
    10 = TEXT
    10.value= <option value="Kategorie-
    20 = TEXT
    20 {
      field= title
      stdWrap.replacement {
        10 {
          search.char= 32
          replace =
        }
        20 {
          search = /
          replace = -
        }
        40 {
          search = ü
          replace = ue
        }
        50 {
          search = ö
          replace = oe
        }
      }
      wrap = |">
    }

    50 = TEXT
    50 {
      field = title
      stdWrap.noTrimWrap = | |</option>|
      stdWrap.insertData = 1
      stdWrap.replacement {
        #10 {
        #  search.char= 32
        #  replace =
        #}
        20 {
          search = /
          replace = -
        }
      }
    }
  }
}


lib.categoryImagesForFixedLayer < lib.categorySelectionForFixedLayerOptions
lib.categoryImagesForFixedLayer {
  renderObj >
  renderObj = COA
  renderObj {
    10 = COA
    10 {
      10 = FILES
      10 {
        references {
          table = sys_category
          uid.dataWrap= {field:uid}
          fieldName = images
        }
        renderObj = COA
        renderObj {
          20 = IMG_RESOURCE
          20 {
            file.import.data = file:current:uid
            file.treatIdAsReference = 1
            file.maxW = 450
          }
          stdWrap.noTrimWrap (
            |
              "{field:title}":"|",
            |
          )
          stdWrap.insertData = 1
        }
      }
    }
    stdWrap.replacement {
      10 {
        search.char= 32
        replace =
      }
    }
  }
}



lib.categoryImageJs = COA
lib.categoryImageJs {
  10 = COA
  10 {
    10 = IMG_RESOURCE
    10 {
      file = fileadmin/user_upload/azh/Produkte/azhDirekt.jpg
      file.maxW = 450
    }
    10.stdWrap.noTrimWrap (
            |
              "default":"|",
            |
    )
    20 < lib.categoryImagesForFixedLayer
  }

  10.stdWrap.wrap (
      <script>
        var categoryImages = {
          |
        }
      </script>
  )
}
lib.categorySelection = COA
lib.categorySelection {
  10 < lib.categorySelectionForFixedLayerOptions
  10.stdWrap.noTrimWrap (
    |
    <select class="selectCategory">
      <option value="">Bitte wählen Sie Ihre Berufsgruppe</option>
      |
    </select>
  <br>
    |
  )
}

lib.LayerContent = COA
lib.LayerContent {
  5 < lib.categorySelectionForFixedLayerUrls
  5.wrap = <div id="categoryLayerLinks" style="display:none">|</div>
  10 < lib.categoryImageJs
  50 < lib.categorySelection
  stdWrap {
    wrap (
        <div class="categoryLayer">
          <span class="title">Ihre gewählte Branche</span>
          <img class="categoryImage" src="" />
          <div class="categoryTitle" id="catLayerTrigger"></div>
          <div class="categoryTitle"></div>
        |
        <div style="clear:both"></div>
        </div>
    )
  }
}

#[globalVar = TSFE:id=2]
[getTSFE().id == 2]
lib.LayerContent {
  stdWrap {
      wrap (
          <div class="categoryLayer" id="categoryLayerRedirect">
            <span class="title">Ihre gewählte Branche</span>
            <img class="categoryImage" src="" />
            <div class="categoryTitle" id="catLayerTrigger"></div>
            <div class="categoryTitle"></div>
          |
          <div style="clear:both"></div>
          </div>
      )
  }
}
[global]

tt_content.author =< tt_content.textpic
tt_content.author {
  templateName = Author
}

tt_content.icontext  < lib.contentElement
tt_content.icontext {
  templateName = Icontext
}
