OpenCms 8语言支持[关闭](OpenCms 8 language support [closed])
我正在尝试建立一个多语种网站(德语和英语)。 我的第一个直观方法是在每篇文章和结构元素中使用语言选择器,以便用两种语言创建我的内容。
问题是我不知道如何切换语言。 怎么能告诉OpenCms使用德文版的文章? 我在哪里可以设置默认语言?
I am trying to build a multilingual website (German and English). My first intuitive approach was to use the language selector in each article and structural element in order to create my content in both languages.
The problem is that I don't know how to switch the language. How can tell OpenCms to use the German version of an article? Where can I set the default-language?
原文:
最满意答案
而不是在点击时将事件附加到您的元素,而是在页面加载时附加它。 由于您已经在使用jquery:
$(function() { //Anything you place in here won't be run until the page has loaded });
所以,在你的情况下,做这样的事情
$(function() { jQuery(".gm_popup .email").click(function(){ var text = jQuery(this).text(); document.location = "mailto:" + text.trim(); }); });
Nailed it
$(document).on('click', '.gm_popup .email', function(){ var text = jQuery(this).text(); document.location = "mailto:" + text.trim(); });
相关问答
更多-
使用Javascript设置onclick时,onclick代码正在运行(When setting onclick using Javascript, the onclick code is running)[2022-12-17]
submit();括号submit(); 导致立即执行该功能。 现在,您尝试将submit的返回值分配给onclick属性。 一个有效的解决方案是使用匿名函数来处理事件。 document.getElementById('select_image').onclick = function () { document.upload.submit(); return; } Parentheses in submit(); causes immediate execution of the fu ... -
React - callbackFromApp函数只运行一次onClick(React - callbackFromApp function only running once onClick)[2024-05-10]
问题是当的父级重新呈现(也就是通过callbackFromApp更新)时,会再次重新执行以下代码片段 let minutes = 1; let totalSeconds = 0; 这会重置计数器,因此在第一次点击后看不到差异。 将这些变量 之外,以便在每次更新时不重置它们。 Problem is that when the parent of gets re-rendered (aka updated ... -
Java代码运行两次(Java code running twice)[2021-03-15]
当我按下提交时,我之前的密码更改页面刷新了整个页面。 出于某种原因,这导致页面被提交两次。 我把事情改成了部分刷新,现在一切运作良好。 不知道为什么刷新不喜欢完全刷新。 但它现在有效。 :) My previous password change page was refreshing the whole page when I pressed submit. For some reason this was causing the page to be submitted twice. I changed ... -
使用document.onclick关闭下拉列表的JavaScript(Javascript closing a dropdown with document.onclick)[2021-09-10]
在另一个事件处理程序中添加事件处理程序通常是错误的。 在顶层绑定你的$(".options_toggle").click()处理程序。 $(document).ready(function() { $(".options_toggle").click(function(e) { // prevent the dropdown from closing instantly when you click the toggle to open it e.stopPropagation() ... -
Javascript运行两次(Javascript running twice)[2023-04-09]
问题是你的canvasDrawing.js,在“不重要的画布东西”中,会导致javascript错误。 如果它描述的画布实际存在,你的styleForm东西只运行一次。 所以将它添加到您的HTML: 魔术将会发生。 或者,在canvasDrawing文件中,在styleForm之后添加这样的子句: var canvas = document.getElementById('floorplan'); if (!canvas) ... -
现在适合我。 我对strip进行了一些修改, split并添加注释# <- here url_base = 'http://sfbay.craigslist.org/search/eby/apa' params = dict(bedrooms=1, is_furnished=1) rsp = requests.get(url_base, params=params) # BS4 can quickly parse our text, make sure to tell it that you're givi ...
-
哇,谢谢jQuery。 使用html,body作为scrollTop函数的选择器已经成为我们很多人很长一段时间的标准练习,现在它的行为有所不同,我们都有很多工作要做。 甚至WORDPRESS CORE FILES在动画功能上使用html,body 。 简而言之:选择器html,body现在将导致动画函数在jQuery v1.12.3中运行两次,而在以前的版本中,情况并非如此。 编辑感谢Developer107以下的第一个评论 由于Firefox需要html和Chrome等需要body ,修复此问题的方法是使 ...
-
循环{}运行两次?(loop{} is running twice?)[2023-04-05]
我想按Enter键会导致CRLF ( \r\n )(在Windows上;在Linux上似乎工作正常),即两个空白字符。 read! 只读取其中一个,下一个read_line调用将返回一个空行(只有\n ( 0x0a )的字符串)。 I guess pressing enter leads to CRLF (\r\n) (on Windows; on Linux it seems to work fine), i.e. two whitespace characters. read! will only re ... -
而不是在点击时将事件附加到您的元素,而是在页面加载时附加它。 由于您已经在使用jquery: $(function() { //Anything you place in here won't be run until the page has loaded }); 所以,在你的情况下,做这样的事情 $(function() { jQuery(".gm_popup .email").click(function(){ var text = jQuery(this).text ...
-
JS上的Noob - 为什么document.onclick无法正常工作?(Noob on JS — why is document.onclick not working properly?)[2021-04-04]
每次单击hoverage元素时,您的单击事件都会冒泡到document ,因此将gallerymake() 和 gallerytake() 。 有关事件的说明,请参阅此页面 。 为了防止这种情况,请使用e.stopPropagation() 。 看一个工作示例的小提琴 。 Your click event bubbles up to the document every time you click the hoverage element, so gallerymake() and gallerytake ...