UPDATE: This developed into a fully functional plugin that works with 2.2.13+ and very likely older version as well!
See this thread for more information:
https://forums.modx.com/thread/90070/new-screencast-ppbhelpmanager-plugin-beta-release#dis-post-494921
Regards,
pepebe
P.S. How do I close a discussion?
--------------------------------------------------------------------
Inspired by this thread: url]
https://forums.modx.com/thread/89412/screencast-helpful-tv-descriptions-in-modxmanager[/url], I've written a small plugin that adds help tab to your resources.
Disclaimer:
* I hammered this today into my computer, so it is only tested on revo2.2.12 and google Chrome (v33).
* I also didn't manage to automatically set the right height for the container surrounding the iframe. The height is therefore fixed to 400px. If your iframed page is taller, you'll you'll have to live with scrollbars to handle the content.
Note: In a few minutes I'll post a link to a quick screencast showing how it works.
Screencast uploaded:
http://quick.as/a0x3colj
The results looks like this:

Note: If the image is not displayed, have a look at the attachment below.
AS always your feedback is most welcome.
Regards,
pepebe
INSTALLATION INSTRUCTIONS
1. Create a new plugin, name it "help" and activate it.
2. Activate the
onDocFormPrerender checkbox inside the System Events tab.
3. Copy the following code into the plugin:
[s]<?php
/*
Add help tab to all templates with a link inside the template description that has a rel="help" attribute.
Example description:
Use this template for XML feeds <a href="add-your-link-here.html" rel="help"></a>
Hints:
* Don't add text to the documentation link or it can be seen inside the template picker.
* href can be any resource relative to the manager directory, as well as any internal or external url.
* Don't forget, that some pages don't like to be put into iframes (googel, for example).
*/
$id = $modx->resource->get('id');
$resource = $modx->getObject('modResource', $id);
$templateObj = $modx->resource->getOne('Template');
$description = $templateObj->get('description');
if (class_exists('DOMDocument')){
$doc = new DOMDocument();
$doc->loadHTML( $description );
$links = $doc->getElementsByTagName( "a" );
foreach($links as $link){
$rel = $link->getAttribute('rel');
if($rel = 'help'){
$url = $link->getAttribute('href');
}
/* We assume that there is always only one link to the template documentation ... */
break;
}
if(!empty($url)){
$content = '<iframe onload="parent.MODx.helpWindow.getEl().unmask();" src="' . $url . '" width="100%" height="100%" frameborder="0"></iframe>';
}
else {
return;
}
}
else {
return;
}
$html = "
<script>
MODx.on('ready',function() {
MODx.addTab('modx-resource-tabs',{
title: 'Help',
id: 'help',
width: '95%',
layout: 'fit',
items: [{
html: '" . $content . "',
height: 400
}]
});
});
</script>
";
$modx->regClientStartupHTMLBlock($html);
return;[/s]
Now all you have to do is adding a link to a template description:
Example:
Some helpful description for your TV <a href="add-your-link-here.html" rel="help"></a>
.
Sidenote: You can only add 255 characters to a template description (its limited in the db).
The result can be any external or internal page. Create your own online documentation and add it to the backend of your clients.
[ed. note: pepebe last edited this post 12 years, 6 months ago.]