layouts/partials/topnav/product-selector.html
{{ $scratch := newScratch }} {{ $productPathData := findRE "[^/]+.*?" .RelPermalink }} {{ $product := index $productPathData 0 }} {{ $version := index $productPathData 1 }} {{ $pageRoot := print $product "/" $version }} {{ $useRootProductLink := or (eq $product nil) (in (slice "resources" "platform") $product) }} {{ $altLinks := .Page.Params.alt_links | default dict }}{{ $influxdbOSSv1 := dict "influxdb/v1" (slice "InfluxDB OSS v1" "v1") }} {{ $influxdbOSSv2 := dict "influxdb/v2" (slice "InfluxDB OSS v2" "v2") }} {{ $influxdbCloud := dict "influxdb/cloud" (slice $.Site.Data.products.influxdb_cloud.name "cloud") }} {{ $influxdb3Core := dict "influxdb3/core" (slice $.Site.Data.products.influxdb3_core.name "core") }} {{ $influxdb3Enterprise := dict "influxdb3/enterprise" (slice $.Site.Data.products.influxdb3_enterprise.name "enterprise") }} {{ $influxdb3Explorer := dict "influxdb3/explorer" (slice $.Site.Data.products.influxdb3_explorer.name "explorer") }} {{ $influxdb3CloudServerless := dict "influxdb3/cloud-serverless" (slice $.Site.Data.products.influxdb3_cloud_serverless.name "cloud-serverless") }} {{ $influxdb3CloudDedicated := dict "influxdb3/cloud-dedicated" (slice $.Site.Data.products.influxdb3_cloud_dedicated.name "cloud-dedicated") }} {{ $influxdb3Clustered := dict "influxdb3/clustered" (slice $.Site.Data.products.influxdb3_clustered.name "clustered") }} {{ $telegraf := dict "telegraf/v1" (slice "Telegraf" "telegraf") }} {{ $telegrafController := dict "telegraf/controller" (slice "Telegraf Controller" "telegraf_controller") }} {{ $chronograf := dict "chronograf/v1" (slice "Chronograf" "chronograf") }} {{ $kapacitor := dict "kapacitor/v1" (slice "Kapacitor" "kapacitor") }} {{ $flux := dict "flux/v0" (slice "Flux" "flux") }} {{ $enterpriseInfluxdb := dict "enterprise_influxdb/v1" (slice "InfluxDB Enterprise" "enterprise_v1") }} {{ $influxdbCloud1 := dict "influxcloud/v1" (slice $.Site.Data.products.influxdb_cloud1.name "v1") }} {{ $productInfo := merge $influxdbOSSv1 $influxdbOSSv2 $influxdbCloud $influxdb3Core $influxdb3Enterprise $influxdb3CloudServerless $influxdb3CloudDedicated $influxdb3Clustered $telegraf $telegrafController $chronograf $kapacitor $influxdb3Explorer $flux $enterpriseInfluxdb $influxdbCloud1 }} {{ define "productLink" }} {{ $specialLink := "" }} {{ if eq .productPath "influxcloud/v1" }} {{ $specialLink = "/platform/#influxdb-cloud-1" }} {{ end }} {{ $defaultAltProductPage := $.context.GetPage ((replaceRE .pageRoot .productPath $.context.Page.RelPermalink) | replaceRE \/$ "") }} {{ $defaultAltProductPageExists := gt (len $defaultAltProductPage.Title) 0 }} {{ $productName := index (index $.productInfo .productPath) 0 }} {{ $productAltLinkKey := index (index $.productInfo .productPath) 1 }} {{ $isCurrentProduct := in $.context.RelPermalink .productPath }} {{ $link := cond (ne $specialLink "") $specialLink (cond .useRootProductLink (print "/" .productPath "/") (cond (isset .altLinks $productAltLinkKey) (index .altLinks $productAltLinkKey) (cond $defaultAltProductPageExists $defaultAltProductPage.RelPermalink (print "/" .productPath "/")))) }} {{ $state := .state | default "" }} {{ index (index $.productInfo .productPath) 0 }}{{ if ne $state ""}} {{ $state }}{{ end }} {{ end }} {{ $templateDefaults := dict "context" . "productInfo" $productInfo "altLinks" $altLinks "pageRoot" $pageRoot "useRootProductLink" $useRootProductLink }}
{{ index (index $productInfo $pageRoot) 0 | default "Select product" }}
InfluxDB 3
{{ template "productLink" (merge (dict "productPath" "influxdb3/core" "state" "New") $templateDefaults) }}
{{ template "productLink" (merge (dict "productPath" "influxdb3/enterprise" "state" "New") $templateDefaults) }}
{{ template "productLink" (merge (dict "productPath" "influxdb3/clustered") $templateDefaults) }}
{{ template "productLink" (merge (dict "productPath" "influxdb3/cloud-serverless") $templateDefaults) }}
{{ template "productLink" (merge (dict "productPath" "influxdb3/cloud-dedicated") $templateDefaults) }}
{{ template "productLink" (merge (dict "productPath" "influxdb3/explorer" "state" "New") $templateDefaults) }}
InfluxDB 2
InfluxDB 1
Telegraf
Other products