Closed q2apro closed 2 years ago
Found a solution:
Create a plugin
Add this code:
$e = &$modx->Event;
if ($e->name == 'OnDocFormRender' || $e->name == 'OnSnipFormRender')
{
$output = "
<script>
// snippet title as document title
if ($('#name').length > 0)
{
parent.document.title = $('#name').val();
}
// document alias as document title
else if ( $('.inputBox[name=alias]').length > 0)
{
parent.document.title = $('.inputBox[name=alias]').val();
}
</script>
";
$e->output($output);
}
I work with a lot of snippets and lose the overview often.
It would be extremely helpful to have the name of the snippet that is edited in the browser set as title of the browser tab.
How can I make this happen? THanks.