| @@ 284-303 (lines=20) @@ | ||
| 281 | */ |
|
| 282 | private function registerMetaDescription($model) |
|
| 283 | { |
|
| 284 | if (!empty($model->meta_description)) { |
|
| 285 | $this->view->registerMetaTag( |
|
| 286 | [ |
|
| 287 | 'name' => 'description', |
|
| 288 | 'content' => ContentBlockHelper::compileContentString( |
|
| 289 | $model->meta_description, |
|
| 290 | Page::className() . ":{$model->id}:meta_description", |
|
| 291 | new TagDependency( |
|
| 292 | [ |
|
| 293 | 'tags' => [ |
|
| 294 | ActiveRecordHelper::getCommonTag(ContentBlock::className()), |
|
| 295 | ActiveRecordHelper::getCommonTag(Page::className()) |
|
| 296 | ] |
|
| 297 | ] |
|
| 298 | ) |
|
| 299 | ) |
|
| 300 | ], |
|
| 301 | 'meta_description' |
|
| 302 | ); |
|
| 303 | } |
|
| 304 | } |
|
| 305 | } |
|
| 306 | ||
| @@ 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 | get_class($product) . ":{$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 | } |
|