为什么Internet Explorer显示此网站与Firefox或Chrome相比居中?(Why does Internet Explorer show this site centered versus Firefox or Chrome?)
我建立了一个网站,当我的用户加载时
http://info.salemgolfclub.org/Account/Logon
用户名和密码用户输入控件在Firefox和Chrome的面板中显示左对齐, 但Internet Explorer在面板中显示它们 。
我希望Internet Explorer也显示左对齐。 我如何确定Firefox和Chrome似乎弄清楚了什么但是Internet Explorer难以理解,因此每个浏览器都是一致的?
对于这个特定的例子以及对未来避免这种情况的最佳做法的一般性评论,我将不胜感激。
I have built a website and when my users load up
http://info.salemgolfclub.org/Account/Logon
the username and password user entry controls show left justified in the panel in Firefox and Chrome but Internet Explorer shows them centered in the panel.
I want Internet Explorer to show left justified as well. How do I determine what Firefox and Chrome seem to figure out but Internet Explorer struggles with so every browser is consistent?
I would appreciate comments both on this particular example as well as general comments on best practices to avoid this type of situation in the future.
原文:https://stackoverflow.com/questions/1251435
最满意答案
如果我从您的评论中正确理解,您可以通过Drupal 6的Image模块的Image Attach子模块将图像附加到节点。
此子模块的工作方式是将图像附加到节点时,它首先为该图像创建一个新节点,然后将该新节点附加到原始节点。 类似于“现代”实体引用在Drupal 7和8中的工作方式。
您可以通过转到
admin/content/node
概述确认附加图像创建新节点,并在列表中看到类型image
的新节点。检索该节点信息的最简单方法是从当前
node
对象的信息中获取它:$paths = $node->image_attach[0]->images
这将检索一组文件路径到各种版本的图像。 例如:
$original_path = $node->image_attach[0]->images['_original']
将链接到您原始的,未改变的图像,而:
$thumbnail_path = $node->image_attach[0]->images['thumbnail']
将链接到其缩略图版本(如果存在)。
您可能知道,Image Attach子模块允许您向节点添加多个图像。 在我的例子中,我通过使用
[0]
盲目地拍摄了第一张图像。 如果你有多个图像,当然应该循环遍历image_attach
数组中的各个条目。如果您希望检索有关连接到原始节点的每个图像节点的更多信息,您还可以加载实际节点本身并使用它:
$nid = $node->image_attach[0]->nid; $image_node = node_load($nid);
在这里,您完全加载引用的节点并提供其所有信息。
然而,后一种情况会导致不必要的开销,因为在完全加载节点时不存在额外的信息。 完整引用已由原始
node
对象内的Image Attach子模块提供。 只知道Image Attach实际上在水下创建额外的图像节点,你可以这样处理。If I understand correctly from your comments, you attach an image to a node via the Image Attach submodule of Drupal 6's Image module.
The way this submodule works is when you attach an image to your node, it creates a new node for that image first and attaches that new node to your original node. In a way similar as how "modern" entity references work in Drupal 7 and 8.
You can confirm that attaching an image creates a new node by going to your
admin/content/node
overview and see a new node of typeimage
appear in the listing.The simplest way of retrieving the information of that node is by fetching it from the information on the current
node
object:$paths = $node->image_attach[0]->images
This will retrieve a set of file paths to the various versions of the image. For example:
$original_path = $node->image_attach[0]->images['_original']
Will link to your original, unaltered image, whereas:
$thumbnail_path = $node->image_attach[0]->images['thumbnail']
Will link to its thumbnail version (if present).
As you might know, the Image Attach submodule allows for you to add multiple images to your node. In my example I have blindly taken the first image present by using
[0]
. If you have multiple images you should, of course, loop over the various entries present on yourimage_attach
array.If you wish to retrieve even more information about each image node that got attached to your original node, you could also load the actual node itself and work with that:
$nid = $node->image_attach[0]->nid; $image_node = node_load($nid);
Here you fully load the referenced node and have all of its info available.
The latter case, however, would cause unnecessary overhead for there is no extra information present when fully loading the node. The full reference is already provided by the Image Attach submodule inside of your original
node
object. Just know Image Attach actually creates extra image nodes underwater which you can treat as such.
相关问答
更多-
在Drupal站点中创建一个块并将其分配给首页中的区域。 在那里通过PHP代码添加了图像。 Create a block in your Drupal site and assign it to a region in the front page. Added the Image via PHP code there.
-
以下是使用node_save使用的示例代码 $filepath = drupal_realpath('misc/druplicon.png'); // Create managed File object and associate with Image field. $file = (object) array( 'uid' => 1, 'uri' => $filepath, 'filemime' => file_get_mimetype($filepath), ' ...
-
如果我从您的评论中正确理解,您可以通过Drupal 6的Image模块的Image Attach子模块将图像附加到节点。 此子模块的工作方式是将图像附加到节点时,它首先为该图像创建一个新节点,然后将该新节点附加到原始节点。 类似于“现代”实体引用在Drupal 7和8中的工作方式。 您可以通过转到admin/content/node概述确认附加图像创建新节点,并在列表中看到类型image的新节点。 检索该节点信息的最简单方法是从当前node对象的信息中获取它: $paths = $node->image_a ...
-
您可以使用drupal_add_js使用'setting'选项通过Drupal将内容传递给Javascript。 添加设置('设置'):将设置添加到Drupal的JavaScript设置全局存储中。 某些模块需要按页面设置才能正常运行。 drupal_add_js(array('myModule'=> array('key'=>'value')),'setting'); 然后,您可以传递drupal_get_path('module','name')返回的路径,并使用Drupal.setting在Javas ...
-
主题中的Drupal路径(Drupal paths in themes)[2024-02-25]
添加base_path()到我的路径开始... added base_path() to beginning of my paths... -
Drupal内容图像URI(Drupal Content Image URI)[2023-11-15]
file_create_url函数就是你所追求的 The file_create_url function is what you're after -
Drupal 7 autocomplete_path函数返回隐藏值(Drupal 7 autocomplete_path function return hidden values)[2024-04-15]
简短的回答是,它超出了核心中自动完成回调的简单功能。 您将需要在Drupal 7中使用改进的AJAX框架来研究自己的解决方案。请参阅http://d7.drupalexamples.info/examples/ajax_example ,了解尽可能使用最少代码的内容。 Found a good answer for this here. -
Drupal 8图像字段值(Drupal 8 Image Field value)[2022-07-27]
您可以使用以下方法获取uri或url: $entity->get('field_image')->entity->getFileUri(); $entity->get('field_image')->entity->url(); 这是因为value()方法应返回字段的值(也称为fid),在这种情况下,该字段是实体引用。 You can use the folowing methods to get the uri or the url: $entity->get('field_image')->entit ... -
Drupal中的这些uri -field总是引用内部数据存储逻辑,因此public://在开头。 Drupal将图像样式用于附加到内容的任何图像。 要检索图像的完整URL,您应该使用image_style_url() : $imgPath = image_style_url('default', $object['und'][0]['uri']); Such uri-fields in Drupal always refer to the internal data-storage logic, henc ...
-
在Drupal 6中以编程方式更新节点路径的正确方法(Proper Way to Update a Node's Path Programatically in Drupal 6)[2024-01-01]
你应该使用path_set_alias 要更新路径,请查看path_nodeapi ,例如: path_set_alias('node/' . $node->nid, $node->path, isset($node->pid) ? $node->pid : NULL, isset($node->language) ? $node->language : ''); You shoud use path_set_alias To update a path, take a look at path_node ...