| @@ 261-280 (lines=20) @@ | ||
| 258 | */ |
|
| 259 | private function registerMetaDescription($model) |
|
| 260 | { |
|
| 261 | if (!empty($model->meta_description)) { |
|
| 262 | $this->view->registerMetaTag( |
|
| 263 | [ |
|
| 264 | 'name' => 'description', |
|
| 265 | 'content' => ContentBlockHelper::compileContentString( |
|
| 266 | $model->meta_description, |
|
| 267 | Page::className() . ":{$model->id}:meta_description", |
|
| 268 | new TagDependency( |
|
| 269 | [ |
|
| 270 | 'tags' => [ |
|
| 271 | ActiveRecordHelper::getCommonTag(ContentBlock::className()), |
|
| 272 | ActiveRecordHelper::getCommonTag(Page::className()) |
|
| 273 | ] |
|
| 274 | ] |
|
| 275 | ) |
|
| 276 | ) |
|
| 277 | ], |
|
| 278 | 'meta_description' |
|
| 279 | ); |
|
| 280 | } |
|
| 281 | } |
|
| 282 | } |
|
| 283 | ||
| @@ 131-150 (lines=20) @@ | ||
| 128 | if (null !== $selected_category = $selected_category_id) { |
|
| 129 | if ($selected_category_id > 0) { |
|
| 130 | if (null !== $selected_category = Category::findById($selected_category_id, null)) { |
|
| 131 | if (!empty($selected_category->meta_description)) { |
|
| 132 | $this->view->registerMetaTag( |
|
| 133 | [ |
|
| 134 | 'name' => 'description', |
|
| 135 | 'content' => ContentBlockHelper::compileContentString( |
|
| 136 | $selected_category->meta_description, |
|
| 137 | Product::className() . ":{$selected_category->id}:meta_description", |
|
| 138 | new TagDependency( |
|
| 139 | [ |
|
| 140 | 'tags' => [ |
|
| 141 | ActiveRecordHelper::getCommonTag(ContentBlock::className()), |
|
| 142 | ActiveRecordHelper::getCommonTag(Category::className()) |
|
| 143 | ] |
|
| 144 | ] |
|
| 145 | ) |
|
| 146 | ) |
|
| 147 | ], |
|
| 148 | 'meta_description' |
|
| 149 | ); |
|
| 150 | } |
|
| 151 | ||
| 152 | $this->view->title = $selected_category->title; |
|
| 153 | } |
|
| @@ 280-299 (lines=20) @@ | ||
| 277 | ]); |
|
| 278 | EventTriggeringHelper::triggerSpecialEvent($specialEvent); |
|
| 279 | ||
| 280 | if (!empty($product->meta_description)) { |
|
| 281 | $this->view->registerMetaTag( |
|
| 282 | [ |
|
| 283 | 'name' => 'description', |
|
| 284 | 'content' => ContentBlockHelper::compileContentString( |
|
| 285 | $product->meta_description, |
|
| 286 | Product::className() . ":{$product->id}:meta_description", |
|
| 287 | new TagDependency( |
|
| 288 | [ |
|
| 289 | 'tags' => [ |
|
| 290 | ActiveRecordHelper::getCommonTag(ContentBlock::className()), |
|
| 291 | ActiveRecordHelper::getCommonTag(Product::className()) |
|
| 292 | ] |
|
| 293 | ] |
|
| 294 | ) |
|
| 295 | ) |
|
| 296 | ], |
|
| 297 | 'meta_description' |
|
| 298 | ); |
|
| 299 | } |
|
| 300 | ||
| 301 | $selected_category = ($selected_category_id > 0) ? Category::findById($selected_category_id) : null; |
|
| 302 | ||