• Resolved Aaron

    (@jstask)


    The documentation states

    Slim SEO supports shortcodes in the meta title and meta description, you can add your own shortcodes here to output your custom dynamic content.

    However, if I do a short code inside my content like “Some[shy]superlongstring” and do not enter a manual meta, the shortcode won’t get executed inside the meta tag.

    • This topic was modified 2 years, 2 months ago by Aaron.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @jstask ,

    A stupid question, but have you registered the shortcode?

    Thread Starter Aaron

    (@jstask)

    Hey,

    Sure I did. Otherwise, the short code won’t get executed inside the Gutenberg editor. Your question make me think you missed the important thing: This only happens if I don’t enter a meta description myself, and keep using the default one. As soon as I enter something, the shortcode works as expected.

    Plugin Author Anh Tran

    (@rilwis)

    I got it. I recorded a video on this case:

    https://monosnap.com/file/khFS47zkyu7eLRXefdrA5mrlioRzhw

    Just a note that shortcodes are not rendered in the preview, but when viewing on the frontend, it’ll rendered correctly.

    Thread Starter Aaron

    (@jstask)

    Hey @rilwis,

    I rechecked and noticed two things:

    1. My own block: No preview inside meta description, but output in the meta-tag without short shortcode execution.
    2. The Core Paragraph Block Works as expected

    I guess it is because I use render callbacks: my block is storing its content inside the block attributes and the safe function is returning null. If this approach is wrong when using render callbacks, I appreciate a hint 😉

    Below are my block attributes in comparison to the core paragraph attributes

    <!-- wp:aaronkessler/text {"size":"5xl","margin":"xl","customMargin":true,"tag":"h1","content":"\u003cmark class=\u0022mark bg-white\u0022\u003e\u003cspan class=\u0022mark-span bg-gradient-to-r from-primary-700 via-primary-500 to-primary-700 text-transparent bg-clip-text\u0022\u003eWebdesign\u003c/span\u003e\u003c/mark\u003e und Medien[shy]gestaltung","gradient":"Primary-Gradient","font":"Display","className":"mark-first-word","anchor":"heading"} /-->
    
    <!-- wp:paragraph -->
    <p>Medien[shy]gestaltung</p>
    <!-- /wp:paragraph -->

    I guess for the preview it is impossible to get it to work, because AFAIK there is no standard for block attribute names.

    But since it is outputting the content without the shortcode execution inside the meta-tag, I guess there must be a way to fix it.

    Thread Starter Aaron

    (@jstask)

    Well, I rethought it and I do return something in my save component now that can be parsed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘shortcode’ is closed to new replies.