Commit 5953b4fa3199e0bc3ce1df92e638c35832ff1b33
1 parent
1e375ebe
паше на тест
Showing
4 changed files
with
19 additions
and
9 deletions
Show diff stats
frontend/microdata/MicrodataFabric.php
| @@ -29,7 +29,10 @@ class MicrodataFabric extends Microdata | @@ -29,7 +29,10 @@ class MicrodataFabric extends Microdata | ||
| 29 | return ($article==null)? | 29 | return ($article==null)? |
| 30 | new OrganizationMicrodata(array_merge(self::getDefaultSettings())) | 30 | new OrganizationMicrodata(array_merge(self::getDefaultSettings())) |
| 31 | : | 31 | : |
| 32 | - new OrganizationMicrodata(array_merge($article,self::getDefaultSettings())); | 32 | + #die(var_dump(self::getDefaultSettings())); |
| 33 | + #die(var_dump(array_merge($article,self::getDefaultSettings()))); | ||
| 34 | + new OrganizationMicrodata(array_merge($article, | ||
| 35 | + self::getDefaultSettings())); | ||
| 33 | } | 36 | } |
| 34 | 37 | ||
| 35 | 38 | ||
| @@ -38,7 +41,13 @@ class MicrodataFabric extends Microdata | @@ -38,7 +41,13 @@ class MicrodataFabric extends Microdata | ||
| 38 | 41 | ||
| 39 | 42 | ||
| 40 | protected static function getDefaultSettings(){ | 43 | protected static function getDefaultSettings(){ |
| 41 | - return require_once (realpath(__DIR__.'/settings/settings.php')); | 44 | + return [ |
| 45 | + 'context'=>"http://schema.org", | ||
| 46 | + | ||
| 47 | + ]; | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + | ||
| 42 | } | 51 | } |
| 43 | 52 | ||
| 44 | } | 53 | } |
| 45 | \ No newline at end of file | 54 | \ No newline at end of file |
frontend/microdata/OrganizationMicrodata.php
| @@ -14,6 +14,8 @@ class OrganizationMicrodata extends Microdata | @@ -14,6 +14,8 @@ class OrganizationMicrodata extends Microdata | ||
| 14 | public $description=null; | 14 | public $description=null; |
| 15 | public $npm=null; | 15 | public $npm=null; |
| 16 | 16 | ||
| 17 | + | ||
| 18 | + public $type=null; | ||
| 17 | public $url=null; | 19 | public $url=null; |
| 18 | public $logo=null; | 20 | public $logo=null; |
| 19 | public $contactPoint=null; | 21 | public $contactPoint=null; |
frontend/microdata/settings/settings.php
frontend/views/layouts/main.php
| @@ -192,7 +192,7 @@ $this->registerMetaTag( | @@ -192,7 +192,7 @@ $this->registerMetaTag( | ||
| 192 | <?php | 192 | <?php |
| 193 | if ($settings->logo != null){ | 193 | if ($settings->logo != null){ |
| 194 | echo | 194 | echo |
| 195 | - "<img itemprop='logo' src='/storage/logo/".$settings->logo."' alt='".\Yii::t('app','ABC short')."' | 195 | + "<img src='/storage/logo/".$settings->logo."' alt='".\Yii::t('app','ABC short')."' |
| 196 | title='".\Yii::t('app','ABC short')."' | 196 | title='".\Yii::t('app','ABC short')."' |
| 197 | >"; | 197 | >"; |
| 198 | }else{ | 198 | }else{ |
| @@ -203,7 +203,6 @@ $this->registerMetaTag( | @@ -203,7 +203,6 @@ $this->registerMetaTag( | ||
| 203 | 'alt' => $settings->name, | 203 | 'alt' => $settings->name, |
| 204 | #'alt'=>\Yii::t('app','ABC short'), | 204 | #'alt'=>\Yii::t('app','ABC short'), |
| 205 | 'title'=>\Yii::t('app','ABC short'), | 205 | 'title'=>\Yii::t('app','ABC short'), |
| 206 | - 'itemprop'=>"logo" | ||
| 207 | ] | 206 | ] |
| 208 | ); | 207 | ); |
| 209 | } | 208 | } |
| @@ -639,9 +638,9 @@ $this->registerMetaTag( | @@ -639,9 +638,9 @@ $this->registerMetaTag( | ||
| 639 | 638 | ||
| 640 | $layoutMicrodata= | 639 | $layoutMicrodata= |
| 641 | [ | 640 | [ |
| 642 | - '@context'=> 'http://schema.org/', | ||
| 643 | - '@type'=> 'Organization', | ||
| 644 | - 'url'=>'http://www.your-company-site.com', | 641 | + 'context'=> 'http://schema.org/', |
| 642 | + 'type'=> 'Organization', | ||
| 643 | + 'url'=>Url::home(true), | ||
| 645 | #'logo'=>'http://www.example.com/logo.png', | 644 | #'logo'=>'http://www.example.com/logo.png', |
| 646 | 'logo'=>Url::home(true)."storage/logo/".$settings->logo, | 645 | 'logo'=>Url::home(true)."storage/logo/".$settings->logo, |
| 647 | 'contactPoint'=>[ | 646 | 'contactPoint'=>[ |