モジュール(Background Images Formatter)を利用して、記事にアップロードした画像を記事のバックグランドにすることができます。本サイトでは、何らかの原因でBackground Images Formatterの表示設定時にエラーが発生して(Ajaxの設定なのでエラーメッセージも表示されなかった)、このモジュールの利用はできませんでした。
モジュールを利用せず、簡単なCSSとJavaScriptで対応することになりました。
var img_url = $('#content-background-div img').attr('src');
$('.page-content #block-system-main').css({ // 記事を表示するエリア
'background-image': 'url("'+img_url+'")',
'background-repeat': 'no-repeat',
'background-size': '100% auto',
'-moz-background-size': '100% auto',
'-webkit-background-size':'100% auto'
});
#node.node-article{ background-color: rgba(255,255,255,0.75); }
<?php print( token_replace('[user:name]' , array('user' => $user) ) ) ; ?>
Notice: Undefined variable: user in eval() (line 2 of /virtual/drills/public_html/drupal7/sites/all/modules/ds/modules/ds_format/ds_format.module(66) : eval()'d code). =>
<?php print( token_replace('[current-user:name]' ) ) ; ?>
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
<?php print( token_replace('[user:name]' , array('user' => $user) ) ) ; ?>
Notice: Undefined variable: user in eval() (line 2 of /virtual/drills/public_html/drupal7/sites/all/modules/ds/modules/ds_format/ds_format.module(66) : eval()'d code). =>
<?php print( token_replace('[current-user:name]' ) ) ; ?>
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
<?php print( token_replace('[user:name]' , array('user' => $user) ) ) ; ?>
Notice: Undefined variable: user in eval() (line 2 of /virtual/drills/public_html/drupal7/sites/all/modules/ds/modules/ds_format/ds_format.module(66) : eval()'d code). =>
<?php print( token_replace('[current-user:name]' ) ) ; ?>
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
<?php print( token_replace('[user:name]' , array('user' => $user) ) ) ; ?>
Notice: Undefined variable: user in eval() (line 2 of /virtual/drills/public_html/drupal7/sites/all/modules/ds/modules/ds_format/ds_format.module(66) : eval()'d code). =>
<?php print( token_replace('[current-user:name]' ) ) ; ?>
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
<?php print( token_replace('[user:name]' , array('user' => $user) ) ) ; ?>
Notice: Undefined variable: user in eval() (line 2 of /virtual/drills/public_html/drupal7/sites/all/modules/ds/modules/ds_format/ds_format.module(66) : eval()'d code). =>
<?php print( token_replace('[current-user:name]' ) ) ; ?>
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・
INSERT INTO new_table (title, body, CUSTOM_FIELD_NAME, ・・・・・・) SELECT title, body.body_value, T1.field_data_CUSTOM_FIEDL_NAME_value, ・・・・・・ FROM node left join field_data_body body on nid = body.entity_id left join field_data_CUSTOM_FIELD_NAME T1 on T1.entity_id = nid ・・・・・・