Back to SEO Extension Support

dimti
dimti

Hi

Try to reproduce: Create laout with support of static pages. Place into layout that tags:


    {% component 'SeoStaticPage' %}
>/head>

And


{% page %}

And, in browser, try go to some static page and fetch error:


An exception has been thrown during the rendering of a template ("The component 'AnandPatel\SeoExtension\Components\StaticPage' does not contain a method 'title'.").
/var/www/october/plugins/anandpatel/seoextension/components/staticpage/default.htm line 11

https://www.diigo.com/item/image/4vrl0/wcdq

How to fix it?

Static pages components worked fine with {% page %} tag. But in your doucmentation use {% component 'staticPage' %}.. May be in that some wrong for me.

Anand Patel
Anand Patel

Thank you for pointing this bug, in recent update i have fixed it, please update your plugin.

and when i have refer static page component earlier it tells {% component 'staticPage' %} on layout, but now they also support {% page %}. so you can use both, though i have changed it to {% page %} documentation.

dimti
dimti

Yeep.

And, how to access to meta_ properties on the layout or page?


{{ this.page.meta_title }}

Not worked for me.

I have double meta_title name on the web-page

Anand Patel
Anand Patel

you can access properties using component alias name for example component alias name is SeoStaticPage. then you need to write

{{ SeoStaticPage.seo_keywords }} 

following fields are exist , you can use it with component alias:

  • seo_title (if title is same as page title then leave it blank SEO Extension will take page title)
  • title (this is page title you can access it using this.page.meta_title too)
  • seo_description
  • seo_keywords
  • canonical_url
  • redirect_url
  • robot_index
  • robot_follow

take care if you have inserted data for fields then only you can get this other wise it may give you error.

Last updated

dimti
dimti

Work perfectly. Thanks!

1-5 of 5