| @@ 271-290 (lines=20) @@ | ||
| 268 | */ |
|
| 269 | private function registerMetaDescription($model) |
|
| 270 | { |
|
| 271 | if (!empty($model->meta_description)) { |
|
| 272 | $this->view->registerMetaTag( |
|
| 273 | [ |
|
| 274 | 'name' => 'description', |
|
| 275 | 'content' => ContentBlockHelper::compileContentString( |
|
| 276 | $model->meta_description, |
|
| 277 | Page::className() . ":{$model->id}:meta_description", |
|
| 278 | new TagDependency( |
|
| 279 | [ |
|
| 280 | 'tags' => [ |
|
| 281 | ActiveRecordHelper::getCommonTag(ContentBlock::className()), |
|
| 282 | ActiveRecordHelper::getCommonTag(Page::className()) |
|
| 283 | ] |
|
| 284 | ] |
|
| 285 | ) |
|
| 286 | ) |
|
| 287 | ], |
|
| 288 | 'meta_description' |
|
| 289 | ); |
|
| 290 | } |
|
| 291 | } |
|
| 292 | } |
|
| 293 | ||
| @@ 141-160 (lines=20) @@ | ||
| 138 | if (null !== $selected_category = $selected_category_id) { |
|
| 139 | if ($selected_category_id > 0) { |
|
| 140 | if (null !== $selected_category = Category::findById($selected_category_id, null)) { |
|
| 141 | if (!empty($selected_category->meta_description)) { |
|
| 142 | $this->view->registerMetaTag( |
|
| 143 | [ |
|
| 144 | 'name' => 'description', |
|
| 145 | 'content' => ContentBlockHelper::compileContentString( |
|
| 146 | $selected_category->meta_description, |
|
| 147 | Product::className() . ":{$selected_category->id}:meta_description", |
|
| 148 | new TagDependency( |
|
| 149 | [ |
|
| 150 | 'tags' => [ |
|
| 151 | ActiveRecordHelper::getCommonTag(ContentBlock::className()), |
|
| 152 | ActiveRecordHelper::getCommonTag(Category::className()) |
|
| 153 | ] |
|
| 154 | ] |
|
| 155 | ) |
|
| 156 | ) |
|
| 157 | ], |
|
| 158 | 'meta_description' |
|
| 159 | ); |
|
| 160 | } |
|
| 161 | ||
| 162 | $this->view->title = $selected_category->title; |
|
| 163 | } |
|
| @@ 291-310 (lines=20) @@ | ||
| 288 | ]); |
|
| 289 | EventTriggeringHelper::triggerSpecialEvent($specialEvent); |
|
| 290 | ||
| 291 | if (!empty($product->meta_description)) { |
|
| 292 | $this->view->registerMetaTag( |
|
| 293 | [ |
|
| 294 | 'name' => 'description', |
|
| 295 | 'content' => ContentBlockHelper::compileContentString( |
|
| 296 | $product->meta_description, |
|
| 297 | Product::className() . ":{$product->id}:meta_description", |
|
| 298 | new TagDependency( |
|
| 299 | [ |
|
| 300 | 'tags' => [ |
|
| 301 | ActiveRecordHelper::getCommonTag(ContentBlock::className()), |
|
| 302 | ActiveRecordHelper::getCommonTag(Product::className()) |
|
| 303 | ] |
|
| 304 | ] |
|
| 305 | ) |
|
| 306 | ) |
|
| 307 | ], |
|
| 308 | 'meta_description' |
|
| 309 | ); |
|
| 310 | } |
|
| 311 | ||
| 312 | $selected_category = ($selected_category_id > 0) ? Category::findById($selected_category_id) : null; |
|
| 313 | ||