Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ 子ページリスト ] 表示要素の中の「画像右上分類名」と「分類」を非表示にしました #1951

Merged
merged 13 commits into from
Apr 5, 2024
Merged
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ e.g.

== Changelog ==

[ Specification Change ][ Child Page List ] Hide "Term's name on Image" and "Taxonomies (all)" display options.

= 1.71.0 =
[ Add function ][ Accordion ] Add plain style to accordion block.
Expand Down
40 changes: 23 additions & 17 deletions src/components/display-items-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const DisplayItemsControl = (props) => {
btn_align, //eslint-disable-line camelcase
} = attributes;

// 「子ページリスト」ブロックかどうかをチェック
const isChildPageList = props.name === 'vk-blocks/child-page';

return (
<PanelBody
title={__('Display item', 'vk-blocks-pro')}
Expand All @@ -36,13 +39,16 @@ export const DisplayItemsControl = (props) => {
setAttributes({ display_image: checked })
}
/>
<CheckboxControl
label={__("Term's name on Image", 'vk-blocks-pro')}
checked={display_image_overlay_term} //eslint-disable-line camelcase
onChange={(checked) =>
setAttributes({ display_image_overlay_term: checked })
}
/>
{/* 「子ページリスト」ブロックの場合、画像右上分類名を表示しない */}
{!isChildPageList && (
<CheckboxControl
label={__("Term's name on Image", 'vk-blocks-pro')}
checked={display_image_overlay_term} //eslint-disable-line camelcase
onChange={(checked) =>
setAttributes({ display_image_overlay_term: checked })
}
/>
)}
<CheckboxControl
label={__('Excerpt', 'vk-blocks-pro')}
checked={display_excerpt} //eslint-disable-line camelcase
Expand All @@ -62,21 +68,21 @@ export const DisplayItemsControl = (props) => {
checked={display_date} //eslint-disable-line camelcase
onChange={(checked) => setAttributes({ display_date: checked })}
/>

<CheckboxControl
label={__('New mark', 'vk-blocks-pro')}
checked={display_new} //eslint-disable-line camelcase
onChange={(checked) => setAttributes({ display_new: checked })}
/>

<CheckboxControl
label={__('Taxonomies (all)', 'vk-blocks-pro')}
checked={display_taxonomies} //eslint-disable-line camelcase
onChange={(checked) =>
setAttributes({ display_taxonomies: checked })
}
/>

{/* 「子ページリスト」ブロックの場合、分類(全項目)を表示しない */}
{!isChildPageList && (
<CheckboxControl
label={__('Taxonomies (all)', 'vk-blocks-pro')}
checked={display_taxonomies} //eslint-disable-line camelcase
onChange={(checked) =>
setAttributes({ display_taxonomies: checked })
}
/>
)}
<CheckboxControl
label={__('Button', 'vk-blocks-pro')}
checked={display_btn} //eslint-disable-line camelcase
Expand Down
Loading