Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* seoSuiteRecoverLongtitle v:0.0.1
* Last edited: 2022-05-01
*
* AUTHOR:
* info@pepebe.de
*
* PLUGIN EVENT(S):
* OnDocFormRender
*
* DESCRIPTION:
* Hide META Title from view and unhide original longtitle
*
* Note: You might want to change the maximum number of characters for seosuite.meta.preview.length_desktop_title
*
**/
switch($modx->event->name){
case 'OnDocFormRender':
$html = "
<style>
/* leider notwendig */
#resource-seosuite-panel .x-hide-display + label {
display: none;
}
</style>
<script type='text/javascript'>
Ext.onReady(function () {
console.log('seoSuiteRecoverLongtitle plugin loaded');
let seosuiteLongtitle = Ext.getCmp('seosuite-longtitle');
seosuiteLongtitle.hide();
let modxResourceLongtitle = Ext.getCmp('modx-resource-longtitle');
modxResourceLongtitle.show();
});
</script>
";
$modx->regClientStartupHTMLBlock($html);
break;
default:
break;
}
/**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment