<![CDATA[ Some hacks to the document tree in manager - My Forums]]> https://forums.modx.com/thread/?thread=32581 <![CDATA[Re: Some hacks to the document tree in manager]]> https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178847 Nice one wink
Saves having to open the doc to see which template it uses.
Feature request for next Evo version?]]>
bunk58 Dec 22, 2010, 04:07 AM https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178847
<![CDATA[Re: Some hacks to the document tree in manager]]> https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178846 Quote from: rthrash at Dec 20, 2010, 02:44 PM

pepebe that’s a neat idea and a way to effectively treat templates as a way to identify content types (e.g., blog, press release, etc.). You might file this as a feature request for the future at http://bugs.modx.com/

Sure,

Unfortunatley I can’t login anymore. There is no option to retrieve a lost password. Documentation tells me:

The Lost password link is only displayed if the administrator has activated it.

Please activate it.

Regards,

pepebe]]>
pepebe Dec 22, 2010, 03:18 AM https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178846
<![CDATA[Re: Some hacks to the document tree in manager]]> https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178845 for a project in Evo I had a similar aim, but not so eager: I just wanted the template name of the document showing up too when hovering on the document in the tree. This is what I did:

In line 118 of the file [tt]/manager/frames/nodes.php[/tt] insert "[tt]template,[/tt] " .
So it gets
$sql = "SELECT DISTINCT template, sc.id, pagetitle,....
In line 134 insert a first parameter "[tt]$template,[/tt] " for [tt]list[/tt] and add the 3 statements following the opening bracket [tt]{[/tt] :
while(list($template,$id,$pagetitle,$parent,$isfolder,$published,$deleted,$type,$menuindex,
$hidemenu,$alias,$contenttype,$privateweb,$privatemgr,$hasAccess) = mysql_fetch_row($result))
        {
$rs=$modx->db->select('templatename',$modx->getFullTableName('site_templates'),"id='$template' ");
$row=$modx->db->getRow($rs);
$templatename=$row['templatename'];

Finally after line 149 add the following:
$alt.= " ".$_lang['page_data_template'].": ".$templatename;

That did it.
ottogal




]]>
ottogal Dec 21, 2010, 01:16 AM https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178845
<![CDATA[Re: Some hacks to the document tree in manager]]> https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178844 http://bugs.modx.com/]]> rethrash Dec 20, 2010, 08:44 AM https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178844 <![CDATA[Some hacks to the document tree in manager]]> https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178843
I wanted to get more information about a document while hovering over it. I added the following items:

* "description"
* "templatename" and
* "templateId"

On top of that I added a class to each document representing the template used.

Example:
* template9 or
* template4.

The idea was to change icons in the document tree so they represent the template used.

Have a look at the attached screenshot to see the results.

To this end I have hacked a few lines into

core/model/modx/processors/resource/getnodes.php

The changes are in line:

Line 44-60
    $c->select(array(
         'id'
        ,'pagetitle'
        ,'longtitle'
        ,'alias'
        ,'description'
        ,'parent'
        ,'published'
        ,'deleted'
        ,'isfolder'
        ,'menuindex'
        ,'menutitle'
        ,'hidemenu'
        ,'class_key'
        ,'context_key'
        ,'template' // pepebe: add template to list of available information
    ));


84-88
/* pepebe: Get a list of available templates and their properties  */

 $templateProperties = $modx->getCollection('modTemplate');  

/* end pepebe */


139-141
/* pepebe add templatenumber to class */
            $class .= ' template'.$item->template;
/* end pepebe */


143-159
/* pepebe enhance tooltip information */
            $qtip = '<dl>';
            if ($item->longtitle != '') {
                $qtip .= '<dt>Longtitle:</dt><dd>'.strip_tags($item->longtitle).'</dd>';
            }
            if ($item->description != '') {
                $qtip .= '<dt>Description:</dt><dd>'.strip_tags($item->description).'</dd>';
            }
            if ($item->template != '') {
                foreach ($templateProperties as $templateProperty) {
                    if($templateProperty->get('id') == $item->template){
                        $qtip .= '<dt>Template:</dt><dd>'.strip_tags($templateProperty->get('templatename')).' ('.strip_tags($item->template).')</dd>';
                    }
                }                
            }
            $qtip .= '</dl>';
/* end pepebe*/


I added a few lines to the bottom of manager/templates/default/css/modx-min.css

div.template8 .x-tree-node-icon {background-image: url("../images/restyle/icons/calender.png")!important;}
div.template9 .x-tree-node-icon {background-image: url("../images/restyle/icons/computer.png")!important;}

(Yeah, I know !important is bad, but it didn’t work without that.)

The new icons are just an examples, but I think you get the idea...


The changes are for MODx Revolution 2.0.5-pl (traditional). You can download the the file below. Don’t forget to remove the .txt extension...

Questions:

1. I’m new to revo, are there any ways to do that without messing around with the core?
2. It works, but is there room for improvement?

Regards,

pepebe
]]>
pepebe Dec 19, 2010, 06:51 PM https://forums.modx.com/thread/32581/some-hacks-to-the-document-tree-in-manager#dis-post-178843