WithCandour / statamic-aardvark-seo

Candour's SEO addon for Statamic
https://statamic.com/marketplace/addons/aardvark-seo
11 stars 18 forks source link

Addon is not working in Blade templates #144

Open FlorianMoser opened 1 year ago

FlorianMoser commented 1 year ago

When using Blade templates and inserting SEO tags using {!! Statamic::tag('aardvark-seo:head') !!}, the tags are added to the HTML, but the fields are not populated (meta-description and other meta values are empty).

rich-williamson commented 1 year ago

+1 to this issue. I can go further and say several of the tags aren't even present let alone populated. I have all the fields filled in the UI and this is the output.

<title></title>
<link rel="canonical" href="">
<meta property="og:url" content="">
<meta property="og:site_name" content="">
<meta property="og:title" content="  ">
<meta property="og:description" content="">
<meta property="og:type" ontent="website">
<meta property="og:locale" content="en-US">
<meta name="twitter:card" content="summary">
AndrewHaine commented 1 year ago

Looking into this I believe this may be caused by the way we're fetching the data for the tag, this will be changing significantly in 2.1 so we'll revisit this issue after we've implemented the changes required for #137

maxi032 commented 1 year ago

I also have this problem. Any news on when it could be fixed?

mojosef commented 1 year ago

@maxi032 I'm including an antlers template that contains the antlers tag for now. Not ideal but works until there is a fix.

@include('seo.head')

-- seo/head.antlers.html

{{ aardvark-seo:head }}

I'm not using the body and footer tags but same process.

wireblue commented 1 year ago

I'm still not quite sure how or why, but switching to the new Antlers version of "runtime" (in config/statamic/antlers.php) seems to have fixed it for us.

We're still using {!! Statamic::tag('aardvark-seo:head') !!} in our blade files (no blade @includes()).

geertjanknapen1 commented 1 year ago

This still seems to be happening. Antlers is on runtime, tried both using Statamic::tag('aardvark-seo:head') and including an .antlers.html file that contains {{ aardvark-seo:head }}.

Am I doing something wrong? When will this be fixed? Issue is quite old and I don't want to be paying for an addon that does not do what it should.

CandourDevs commented 1 year ago

Hi @geertjanknapen1

Thanks for your message. We'll be addressing the current list of open bugs in July - this is on top of the list, so will be addressed within the month. We'll post an update as soon as this is ironed out.

geertjanknapen1 commented 1 year ago

@CandourDevs And there's no workaround? The project I am working on is supposed to go live on the first of July, no SEO is a major showstopper.

geertjanknapen1 commented 1 year ago

I did some digging. Seems that it's not an issue with the tags or anything, but with the way data is retrieved. At least that is the case for my project, which is highly customized.

As an example. PageDataParser::generatePageTitle() checks the data variable for a meta_title by doing $data->get('meta_title'). However, for me that will never work since it should be checking the entry which is a product in this case, if I'd change it to $data['product']->meta_title it works, but then it would only work for product entries, which is ofcourse not the case.

Could this be because we also use statamic/eloquent-driver to save entries in the database, and have a custom wrapper for entries?

The story basically boils down to one question; Is aardvark-seo compatible with the statamic/eloquent-driver or should I look for other options?

CandourDevs commented 1 year ago

@CandourDevs And there's no workaround? The project I am working on is supposed to go live on the first of July, no SEO is a major showstopper.

Hi @geertjanknapen1 apologies that we're unable to address this issue before the go-live date for your project. Considering this blocker, please let me know if you have downloaded a paid version of the addon and I can arrange a full refund for you.

geertjanknapen1 commented 1 year ago

@CandourDevs No need to apologize, the deadline isn't yours to meet. I'm also sure you guys are just as busy as me and trying your best to address the issues. What is important to me though is whether the addon is compatible with the statamic/eloquent-driver package.

I think I will be coming up with a custom workaround until you guys have been able to address the issues, but if we later find out that the problem is not the issues but compatibility with the eloquent-driver package, then I'd rather not spend time on a workaround.

So, is aardvark-seo compatible with the statamic/eloquent-driver or should I look for other options?

CandourDevs commented 1 year ago

Hi @geertjanknapen1 thanks for your response - at the moment, the addon is not compatible with statamic/eloquent-driver but this is a function we're looking to bring into the addon as part of the new roadmap for the addon.

geertjanknapen1 commented 1 year ago

@CandourDevs Right, thank you very much! I look forward to the development of the plugin, for now, I will be building something custom.

semvgelooven commented 11 months ago

@CandourDevs any update on this issue?

CandourDevs commented 11 months ago

Hi @semvgelooven

This is currently a work in progress within the dev team, we're hoping to have this ironed out shortly.

We'll send you an update once this is fixed.