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

Feature request: Prefill the seo fields based on the fields of the page #23

Open
boazpoolman opened this issue Sep 21, 2022 · 4 comments
Assignees
Labels

Comments

@boazpoolman
Copy link

Feature request

Summary

It would be nice to have the seo fields be prefilled based on the data of the page. So for example the seo title would be prefilled based on the actual title of the page.

Why is it needed?

Because the page title and seo title will often be the same. So it makes sense that you would have to input it just once instead of twice. This also makes it easier to update the title in the future. As you would only have to update it once.

Suggested solution(s)

Have an interface on the settings page of the plugin where you can set how the fields should be built up.
So for example for the seo title I can select the title field of the content type to have that be used to prefill the seo title.

It would also be cool if we can inject some extra text. So my seo title could be build up by giving the plugin a string like Strapi | [title] where [title] will be replaced by the actual title of the page.

Related issue(s)/PR(s)

None that I know of.

@SalahAdDin
Copy link

@boazpoolman Unfortunately, it won't be done, check this issue.

@Mcastres
Copy link
Collaborator

In fact, automatically filling fields from other fields is not something we encourage you to do at Strapi. However, I will definitely think about a way to import the content of another field as the UID does! Will work on that during the month of November

@Mcastres Mcastres added the todo label Oct 10, 2022
@Mcastres Mcastres self-assigned this Oct 10, 2022
@antokhio
Copy link

antokhio commented Jul 1, 2023

I've would suggest let user define some custom controller function or service for that. Like if entry is saved you can call this function from seo ui panel via button.

So basically you can have something like:

interface CoreServiceWithSeo extends GenericService<T> {
  seo: (ctx) => Promise<Partial<SeoComponetType>>;
}

export default factories.createCoreService<CoreServiceWithSeo>('api::bla.bla', ({ strapi }) =>  ({
  async seo(ctx) {
    ...
    return { ...data }
  },
});

And let user decide how to handle this if he want, prolly can assemble a PR for that, with proper types handling...

@SalahAdDin
Copy link

In fact, automatically filling fields from other fields is not something we encourage you to do at Strapi. However, I will definitely think about a way to import the content of another field as the UID does! Will work on that during the month of November

One year ago, no signs of this development.

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

No branches or pull requests

4 participants