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

how to change style of seo form #25

Open
muhammedfayaz opened this issue Mar 25, 2024 · 5 comments
Open

how to change style of seo form #25

muhammedfayaz opened this issue Mar 25, 2024 · 5 comments

Comments

@muhammedfayaz
Copy link

how to add a hint in each input field

@ralphjsmit
Copy link
Owner

Hey @muhammedfayaz, thank you for your message! I'm afraid that that is not yet possible right now, but I am open to a PR that changes the SEO class to this:

class SEO
{
    public static function make(array $only = ['title', 'author', 'description'], Closure $modifyTitleFieldUsing = null, ...): Group
    {
        return Group::make(function (Group $component) use ($modifyTitleFieldUsing) {
            $titleField = TextInput::make('title')
                ->translateLabel()
                ->label(__('filament-seo::translations.title'))
                ->columnSpan(2);

            if ($modifyTitleFieldUsing) {
                $titleField = $component->evaluate($titleField, ['field' => $titleField], [$titleField::class => $titleField]);
            }

          return Arr::only([
              'title' => $titleField,
               // ...
// ...

@muhammedfayaz
Copy link
Author

I talked about the hint below field not the title

@ralphjsmit
Copy link
Owner

Yes, I just used the title field as example, but you would implement it like this for every other input field, so you can in the end just choose what you want. I don't have time quickly to implement this myself, but as I said I'm open to a PR if you are.

@AlexanderFalkenberg
Copy link

@ralphjsmit Would it be possible to add something like ->translatable() using the closure?

@ralphjsmit
Copy link
Owner

@AlexanderFalkenberg If this closure functionally is PR'ed (I talked about that I was open for a PR to it), then it would be possible yes, as you could yourself modify the TextInput and other form fields (each field a closure $modify.. closure). Don't have the time to do it myself right now but if you want to PR I'm totally okay.

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

3 participants