How to create a custom html between the form and title of setupShowOperation #1356
Replies: 2 comments 1 reply
-
To insert custom HTML between the title and the form in the Show operation in Backpack, you should use a widget and place it in the appropriate section. Backpack's default template for CRUD operations provides two main widget sections: To achieve what you want (custom HTML between the title and the form), you should add your custom HTML as a widget in the public function setupShowOperation()
{
// Add your custom HTML as a widget after the title, before the form
\Widget::add([
'type' => 'div',
'class' => 'alert alert-info',
'content' => 'This is my custom HTML between the title and the form.',
])->to('after_content');
// ... your other show operation setup
} This will render your custom HTML exactly between the title and the form, as shown in your screenshot. You can use any HTML you want in the For more details, see the official documentation on adding custom sections (widgets) to the Show operation and widgets in general in Backpack.
ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️ Relevant sources: Github Issue (closed): [Repeatable] Show custom balde data |
Beta Was this translation helpful? Give feedback.
-
This code is a card. How to make it a view with data to be passed? ` $userCount = \App\Models\User::count();
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It is not a field of "setupShowOperation" but a custom html.
How to create a custom html between the form and title of setupShowOperation?
See below
https://i.imgur.com/9k6k2pu.png
Beta Was this translation helpful? Give feedback.
All reactions