Comments (3)
So the way you will want to do this will be using the SEOmatic APIs... something like this:
{% set rentalPrice = entry.rentalPrice %}
{% do seomatic.meta.seoDescription(entry.metaDescription|replace({'[rentalPrice]': rentalPrice})) %}
See here for details: https://nystudio107.com/docs/seomatic/using/#seomatic-variables
Also you generally don't need a separate metaDescription
field in Craft, typically you can set up content mapping in SEOmatic -> Content SEO as discussed here: https://nystudio107.com/docs/seomatic/overview.html#the-meta-cascade
Or if you really do need a per-entry custom SEO overrides, you can use an SEO Settings field so things will work more automatically for you: https://nystudio107.com/docs/seomatic/fields.html
from craft-seomatic.
Thank you, Andrew. It works and was exactly what I was looking for. I read earlier the pages of the last 2 links. I decided to create and use separate meta fields for 2 reasons assuming that SEOmatic stores its data separate from or different to Craft CMS:
- If the plugin is discontinued or I decide to uninstall it, I would like to have saved the meta information with my entries.
- It is probably easier to handle exports of entries which include meta data.
Honestly, I don't know how SEOmatic technically works and where it stores the data. I just didn't want to loose it or re-enter it when the plugin changes (bug, discontinuation, price increase, etc.).
from craft-seomatic.
Okay, sounds good. Generally you don't need a separate meta description, as pulling from existing content via Content SEO usually works better than manually written descriptions/titles, because they reflect the content on-page.
from craft-seomatic.
Related Issues (20)
- Alt Tags not being seen through site audit on multiple crawlers HOT 1
- Google Web Stories HOT 1
- Error on save SeoMatic settings HOT 2
- Unable to change SEO metafields after changing entry type HOT 5
- How to update frontendTemplatesContainer via content migration HOT 2
- [5.0.2] - Error rendering template string -> Variable "date" does not exist HOT 4
- Canonicals and hreflangs for paginated paginas HOT 3
- Duplicate section in Content SEO HOT 1
- Sitemap URL inconsistencies HOT 2
- `disallowRobots` does't override SEOmatic settings HOT 1
- Internal Server Error when opening Site Settings HOT 9
- Updated SEO description - not displaying correctly in template HOT 6
- Managment of ai.txt HOT 2
- Default SEO Image Source is not rendered HOT 10
- Unable to view "Site Settings" tab in control panel HOT 2
- Some SEOmatic twig variables don't always render og tags properly in Craft 5 HOT 8
- Add support for the Microsoft Clarity Tag
- Poor performance showing up the in debug bar HOT 1
- Google Consent Mode v2 HOT 2
- Structured Data outputs SEO Title Source as site name HOT 3
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 craft-seomatic.