Sometimes it might be useful to define HTML Meta Tags in a page. You can set e. g. search keywords anywhere on a page like
<tc:meta name="format-detection" content="telephone=#{metaController.formatDetection ? 'yes' : 'no'}"/>
<meta charset='UTF-8'> <meta name='viewport' content='width=device-width, initial-scale=1.0'>
This example toggle the Phonenumber detection on some smartphone browsers.
<?xml version="1.0" encoding="UTF-8"?> <!-- * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. --> <ui:composition template="/main.xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:tc="http://myfaces.apache.org/tobago/component"> <ui:param name="title" value="Meta"/> <tc:panel id="meta-panel"> <p> Sometimes it might be useful to define <tc:link label="HTML Meta Tags" link="https://www.w3.org/wiki/HTML/Elements/meta"/> in a page. You can set e. g. search keywords anywhere on a page like <pre><code class="language-markup"><tc:meta name="format-detection" content="telephone=\#{metaController.formatDetection ? 'yes' : 'no'}"/></code></pre> The result is a meta tag in the HTML head. Tobago will render these meta tags automatically, if they aren't defined: <pre><code class="language-markup"><meta charset='UTF-8'> <meta name='viewport' content='width=device-width, initial-scale=1.0'></code></pre> </p> <p> <tc:meta name="format-detection" content="telephone=#{metaController.formatDetection ? 'yes' : 'no'}"/> This example toggle the Phonenumber detection on some smartphone browsers. <tc:selectBooleanCheckbox value="#{metaController.formatDetection}" itemLabel="format detection"> <tc:event /> </tc:selectBooleanCheckbox> By selecting the checkbox a <br/> Example phone number: +1 234 567 890. </p> </tc:panel> </ui:composition>