page documentation input placement :( - Mendix Forum

page documentation input placement :(

2

the amount of times I’ve added a class to “page documentation field” instead of “class field” is more than I’d like to admit.

the “class input field” is usually the 2nd input field, unless its a page, then its the third.

I’m also curious to see hoe many people actually use the documentation field, I’ve never seen it being used =(

can we maybe get rid of it? or atleast put it below the style input field?

cheers,

proposed solutions:

asked
6 answers

@ockert, that script is actually pretty good.

It’s amazing that MX doesnt just generate the page name as a class by default.

I’ll add that as solution 3, because it does solve a lot of the same issues.

Created

Hi Jason

If you intend to use a class on a page manually there is in fact a way to do it in an automated fashion, where you never have to manually edit it in MBM.

This will result in the automated generation of a class on a page as follows:

Here the class is “page-Anonymous_pg_home”

The following can be added to a HTMLSnippet, placed in an MBM snippet component, and that can then be placed in all the layouts

var cf=mx.ui.getContentForm();
if(!cf.tainted){
    console.log('Indeed modifying Navigation');
    var _onNavigation=cf.onNavigation;

    cf.onNavigation=dojo.hitch(
        cf,
        function(){
            _onNavigation();
            console.log('Executing Extension...');
            cf.prevPage=true;
            //remove old class
            //remove old class
            document.body.classList=[];
            //add new class
            dojo.addClass(
                dojo.query('body')[0],
                'page-'+mx.ui.getContentForm().path.replace('.xml','').replace('.page','').replace('.','_').replace('/','_')
            );
        }
    )
    cf.tainted=true;
}else{
    console.log('Not modifying Navigation');
}

There is also a way to automate this even further that you dont have to place the MBM snippet in layouts but the above is also managable.

It is true, people dont document their Mendix projects, and that is usually a result of either bad management or poor work ethic

 

 

Created

do you guys mind sharing some screenshots of things you have in the documentation property?
I’ve never seen it been used before and curious if it can increase our workflow.

Created

@larn I think both are good solutions:

  • Add documentation property to all elements.
  • Reorder the documentation property to last element in properties.
Created

Documentation is very important, and definitely not something that should be removed because you simply misclick.

A re-order maybe. Or by reverse thinking: adding the documentation tab to every other element. So that it can be used when necessary.

 

Created

I do make use of the documentation property. Although I would prefer to have more visible options for adding documentation to a page, I dont think it should be removed. I’m thinking that simply reordening the properties should be sufficient.

Created