GithubHelp home page GithubHelp logo

Comments (3)

khalwat avatar khalwat commented on June 18, 2024

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.

philipschilling avatar philipschilling commented on June 18, 2024

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:

  1. If the plugin is discontinued or I decide to uninstall it, I would like to have saved the meta information with my entries.
  2. 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.

khalwat avatar khalwat commented on June 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.