Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between Aardvark SEO tags and Yield tag #150

Closed
jasonbradberry opened this issue Nov 16, 2022 · 5 comments
Closed

Conflict between Aardvark SEO tags and Yield tag #150

jasonbradberry opened this issue Nov 16, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@jasonbradberry
Copy link

When I added the Aardvark SEO tags to my layout view, the yield tag I was using in that layout stopped working.

The Yield tag itself was rendering fallback content on the page, which seems to mean that there was a clash that was causing the Aardvark SEO tags to somehow cause the section content from within {{ template_content }} to not be pulled through into the Yield tag.

Here's my layout file (the Yield tag is in the header):

<!doctype html>
<html lang="{{ site:short_locale }}">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        {{ aardvark-seo:head }}
        <link rel="stylesheet" href="{{ mix src='css/site.css' }}">
        <link rel="stylesheet" href="https://use.typekit.net/jdv4ubh.css">
    </head>
    <body>
        {{ aardvark-seo:body }}
        <header class="header-bar {{ yield:header_color }}is-aqua{{ /yield:header_color }}">  
            <a href="#nav" class="nav-toggle">
                <div class="nav-toggle__dots">
                    <span></span>
                    <span></span>
                    <span></span>
                    <span></span>
                </div>
                <span class="nav-toggle__text">Menu</span>
            </a>
        </header>
        …
        <script src="{{ mix src='/js/site.js' }}"></script>
        {{ aardvark-seo:footer }}
    </body>
</html>

And here's the corresponding Section tag from the page view file, which should be sending it's contents to the Yield tag to replace the fallback content:

{{ section:header_color }}is-lemon{{ /section:header_color }}

@xuneXTW
Copy link
Contributor

xuneXTW commented Nov 30, 2022

We are experiencing the same problem here. Would be pretty improtant to fix this. Otherwise we are not able to use the plugin on the page.

@xuneXTW
Copy link
Contributor

xuneXTW commented Nov 30, 2022

@AndrewHaine @jackwakefield
The Problem seems to be here (Tags/AardvarkSeoTags.php, method: head)

    if (config('statamic.antlers.version') == 'regex') {
        $view = view('aardvark-seo::tags.head', $data);
    } else {
        $view = View::make('aardvark-seo::tags.head', $data->all());
    }

If i return the view with the helper function "view", all my sections will be rendered correctly. Just with the "View::make" implementation they will be cleared somehow.

@AndrewHaine
Copy link
Contributor

Hi there,

Please could I confirm the following:

  • The version of Aardvark installed
  • The version of Statamic installed
  • The antlers parser you're using

I'm currently unable to replicate this on a fresh Statamic 3.3.59 instance with Aardvark 2.0.30 with either the regex or runtime parser.

Thanks,
Andrew

@xuneXTW
Copy link
Contributor

xuneXTW commented Dec 1, 2022

Hi @AndrewHaine

Here are my details:

Environment
Application Name: zahnarztzentrum.ch
Laravel Version: 9.42.2
PHP Version: 8.1.6
Composer Version: 2.3.7
Environment: local
Debug Mode: OFF
URL: zahnarztzentrum.test
Maintenance Mode: OFF
Statamic
Addons: 5
Antlers: runtime
Version: 3.3.59 PRO

Statamic Addons
jacksleight/statamic-miniset: 0.3.1
parfaitementweb/statamic-country-fieldtype: 1.0.0
raynl/generate-slug: 1.1.1
rias/statamic-address-field: 1.0.3
withcandour/aardvark-seo: 2.0.30

The issue is kinda weird. If you add one yield / section-pair it works fine. We have 2 yield tags in the header and with the tag inserted in the header it will display only one of them. With the response changed to the "view()" helper it will display both of them.

@joshuanoyes joshuanoyes added the bug Something isn't working label Jun 1, 2023
@CandourDevs
Copy link

We are closing this issue as we are unable to replicate, and it seems to refer to a version of Aardvark for which we are no longer fixing bugs. If this is still an issue in the latest version of Aardvark, please let us know, along with further details of how to reproduce.

@CandourDevs CandourDevs closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants