Comments (4)
Are the fields saving correctly? Also, could you let me know what version of Craft & the plugin you are using, any other plugins you have installed, and the template code you are using.
from seo.
I might be having the same issue.
Fields are populated if I reopen the page in Admin, so they must be saving OK.
However when in twig, I always get into:
seo is not defined
part
Beside adding SEO field is there anything else that I should do in order for seo
to be defined?
from seo.
@robi-bobi It sounds like you're not setting the seo
variable. If you're using the snippet from the docs, try changing:
{% if seo is not defined %}
{% set seo = craft.seo.custom(siteName, '', false) %}
{% endif %}
to
{% if seo is not defined and entry.seo is defined %}
{% set seo = entry.seo %}
{% endif %}
{% if seo is not defined %}
{% set seo = craft.seo.custom(siteName, '', false) %}
{% endif %}
From the docs:
The code snippet above assumes that you will be creating a variable call seo in your templates that will return either the SEO field or a custom SEO object (see below).
You need to set the seo
variable. In the example above, we're setting it to whatever the current entry
's seo
field is.
from seo.
Thank you, that was it.
from seo.
Related Issues (20)
- Focus Keywords in single entry is not available HOT 11
- Canonical URL not in sitemap
- All redirects return 404 HOT 5
- Sitemap is being generated with leading spaces causing invalid XML HOT 2
- Site name is not updating HOT 2
- Grouped Section Sitemap Empty HOT 5
- [FR] No way to disable the canonical header
- Focus Keywords not working on Commerce Products
- Upgrading SEO data format fails
- JS error for titles when saving entries
- Focus Keywords Unavailable HOT 3
- Table of contents parsing code with '#' in code block
- Is Pro required for Focus keywords to work? HOT 1
- The sections are not indexed and not in the sitemap HOT 2
- Focus keywords fields not working HOT 2
- Environment check for production always returns false if ENVIRONMENT is not set HOT 21
- Noindex issue with new google search console HOT 4
- [FR] support label localization
- Changing the title configuration doesn't work HOT 1
- Default Social Image (not available when allowAdminChanges set to no) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seo.