diff --git a/Admin/AdsensePlacement/Infrastructure/FieldMapping/AdsensePlacementFieldMapper.php b/Admin/AdsensePlacement/Infrastructure/FieldMapping/AdsensePlacementFieldMapper.php index bf4aae2e..dbd67be0 100644 --- a/Admin/AdsensePlacement/Infrastructure/FieldMapping/AdsensePlacementFieldMapper.php +++ b/Admin/AdsensePlacement/Infrastructure/FieldMapping/AdsensePlacementFieldMapper.php @@ -105,6 +105,19 @@ final class AdsensePlacementFieldMapper implements FieldMapperInterface 'adsense-placementSearchBetweenFormat' => ['group' => 'search_results', 'attribute' => 'search_between_format'], 'adsense-placementSearchBetweenPosition' => ['group' => 'search_results', 'attribute' => 'search_between_position'], 'adsense-placementSearchBetweenEvery' => ['group' => 'search_results', 'attribute' => 'search_between_every'], + + // Page Visibility (grupo especial _page_visibility) + 'adsense-placementVisibilityHome' => ['group' => '_page_visibility', 'attribute' => 'show_on_home'], + 'adsense-placementVisibilityPosts' => ['group' => '_page_visibility', 'attribute' => 'show_on_posts'], + 'adsense-placementVisibilityPages' => ['group' => '_page_visibility', 'attribute' => 'show_on_pages'], + 'adsense-placementVisibilityArchives' => ['group' => '_page_visibility', 'attribute' => 'show_on_archives'], + 'adsense-placementVisibilitySearch' => ['group' => '_page_visibility', 'attribute' => 'show_on_search'], + + // Exclusions (grupo especial _exclusions - Plan 99.11) + 'adsense-placementExclusionsEnabled' => ['group' => '_exclusions', 'attribute' => 'exclusions_enabled'], + 'adsense-placementExcludeCategoriesAdv' => ['group' => '_exclusions', 'attribute' => 'exclude_categories', 'type' => 'json_array'], + 'adsense-placementExcludePostIdsAdv' => ['group' => '_exclusions', 'attribute' => 'exclude_post_ids', 'type' => 'json_array_int'], + 'adsense-placementExcludeUrlPatterns' => ['group' => '_exclusions', 'attribute' => 'exclude_url_patterns', 'type' => 'json_array_lines'], ]; } } diff --git a/Admin/AdsensePlacement/Infrastructure/Ui/AdsensePlacementFormBuilder.php b/Admin/AdsensePlacement/Infrastructure/Ui/AdsensePlacementFormBuilder.php index b70f6da7..3a40fd24 100644 --- a/Admin/AdsensePlacement/Infrastructure/Ui/AdsensePlacementFormBuilder.php +++ b/Admin/AdsensePlacement/Infrastructure/Ui/AdsensePlacementFormBuilder.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ROITheme\Admin\AdsensePlacement\Infrastructure\Ui; use ROITheme\Admin\Infrastructure\Ui\AdminDashboardRenderer; +use ROITheme\Admin\Shared\Infrastructure\Ui\ExclusionFormPartial; /** * FormBuilder para AdSense Placement y Google Analytics @@ -96,6 +97,47 @@ final class AdsensePlacementFormBuilder $html .= 'No mostrar anuncios a usuarios con sesion iniciada en WordPress'; $html .= ''; + // ============================================= + // Visibilidad por tipo de pagina + // Grupo especial: _page_visibility (Plan 99.11) + // ============================================= + $html .= '
'; + $html .= ' '; + $html .= ' Mostrar en tipos de pagina'; + $html .= '
'; + + $showOnHome = $this->renderer->getFieldValue($cid, '_page_visibility', 'show_on_home', true); + $showOnPosts = $this->renderer->getFieldValue($cid, '_page_visibility', 'show_on_posts', true); + $showOnPages = $this->renderer->getFieldValue($cid, '_page_visibility', 'show_on_pages', true); + $showOnArchives = $this->renderer->getFieldValue($cid, '_page_visibility', 'show_on_archives', true); + $showOnSearch = $this->renderer->getFieldValue($cid, '_page_visibility', 'show_on_search', true); + + $html .= '