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

Missing field "query-input" #10

Open
ajoudeh-personal opened this issue Oct 9, 2023 · 3 comments
Open

Missing field "query-input" #10

ajoudeh-personal opened this issue Oct 9, 2023 · 3 comments

Comments

@ajoudeh-personal
Copy link

ajoudeh-personal commented Oct 9, 2023

Hi,

I use below code to generate WebSite schema

$siteLinks->potentialAction = new SearchAction(['target' => Yii::$app->urlManager->createAbsoluteUrl(['/site/search/', 'q' => '{search_term_string}']), 'query' => 'required name=search_term_string']);

i got this error from Google Search Test:

Missing field "query-input"

And '@context' => 'http://schema.org' need to be '@context' => 'https://schema.org'

Any Advice?

Thanks

@simialbi
Copy link
Owner

simialbi commented Oct 9, 2023

Hi @ajoudeh-personal

The @context I'll fix in the upcoming release. About the query-input: That seems to be some Google Thing, it's not documented in the specs (https://schema.org/Action). We may build something to dynamically add properties 🤔.

@ajoudeh-personal
Copy link
Author

yes i see schema doc site, but when i fix it as workaround, its be valid in both site validation Google & Schema.

my work around is to pass potentialAction as json ["@type" => "SearchAction", 'target' => Yii::$app->urlManager->createAbsoluteUrl(['/site/search/']) . "?q={search_term_string}", 'query-input' => 'required name=search_term_string'];

Screenshot 2023-10-09 at 3 17 49 PM

@simialbi
Copy link
Owner

simialbi commented Oct 9, 2023

yeah but it's not even schema org property compliant (id-syntax instead of camelCase). Google 🤦🏻‍♂️...
Maybe user DynamicModel as base to be able to add properties 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants