By admin, 16 二月, 2015

 
function css(a) {
    var sheets = document.styleSheets, o = {};
    for (var i in sheets) {
        var rules = sheets[i].rules || sheets[i].cssRules;
        for (var r in rules) {
            if (a.is(rules[r].selectorText)) {
                o = $.extend(o, css2json(rules[r].style), css2json(a.attr('style')));
            }
        }

标签

By admin, 15 二月, 2015

pre {
    white-space: pre-wrap;       /* CSS 3 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

标签

By admin, 15 二月, 2015

Drupal 7的managed_file类型有个bug,不支持prefix和suffix属性,可以通过增加一个container绕过:

$array['rows'][] = array(
  'file_managed_container' => array(
    '#prefix' => '<td>',
    '#suffix' => '</td>',
    'file_managed_element' => array(
      '#type' => 'managed_file',
      ...
    ),
  ),
);

 

标签

By admin, 14 二月, 2015

An example of view block with related nodes based on 'tags'.
1. Create a block (take a look at screenshots below)
2. Add a relationship: Taxonomy term: Content using: Tags
3. Add contextual filter: (field_tags) Content: Nid

When the filter value is NOT available
Provide default value -> Content ID from URL

MORE
check: Exclude
this contextual filter will remove current node from the view
4. Add contextual filter: Taxonomy term: Term ID

标签

最新评论