How to create a section without adding it to the menu

Sometimes we need to create a section in KAS but it doesn't necessarily needs to be part of the menu. Similar to edit sections.

When we create an edit page, this pages are only linked from view pages (edit button) or if we create a link somewhere else in KAS by using the getPath() function.

We can do something similar for non-edit pages, such as view pages or add pages. But we need to create the URL in a smart way:

Let's think we are using an action button:

 

$actionButton[0] = 
'/kas/op_PAGE~NAME-'.$KMID.'-'.$KSMID.'-'.$KSMOID.'_'.$idvalue.'_VDNWL.kas:PAGE NAME:<i class="fas fa-layer-plus"></i>';

 

or (RECOMMENDED)

 

$actionButton[0] = 
getPath('MENU NAME','SUBMENU NAME','PAGE NAME','VDNWL',$idvalue).':PAGE NAME:<i class="fas fa-layer-plus"></i>';

 

or If the next page has pagination:

 

$actionButton[0] = 
getPath('MENU NAME','SUBMENU NAME','PAGE NAME','VDNWL','-0-100-'.$idvalue).':PAGE NAME:<i class="fas fa-layer-plus"></i>';

 

In either wat the important thing is keep in mind that $KMID or The main section in getpath() iis the current Menu folder or the folder in KAS where we need to save our new doucment.

We also need to provide the option type string, in order to do that we need to add an ID (because the system might think it is an edit section), if no ID is required simply pass 0 (it must be string with numeric value)

For example, the following will redirect to something like this
/kas/op_VIEW~BANNERS-2-6-32_0_VIPLDS.kas

 

$actionButton[0]=
getPath('CONTENT','HOME','VIEW BANNERS','VIPLDS','0').':VIEW BANNERS:<i class="fas fa-layer-plus"></i>';

 

While the following will find the option types on the database and do its job in the background
/kas/op_VIEW~BANNERS-2-6-32.kas

 

$actionButton[0]=
getPath('CONTENT','HOME','VIEW BANNERS').':VIEW BANNERS:<i class="fas fa-layer-plus"></i>';

 

Current Core clarification — Client Categories

A non-menu Add page does not need a setOption entry. Create its Core PHP file under the registered main section and pass its option string to getPath. For example, getPath('SECTION', 'SUBSECTION', 'ADD ITEM', 'FAH') supplies the required options for the Add form and color picker. Current Core automatically supplies ID 0 when an option string is given and the ID argument is omitted. Explicit '0' remains supported; it is a placeholder and is not a record ID for INSERT. Register the visible parent page normally, and use an array action button to open the Add page.

Initialize newly deployed sections

After deploying a new or changed visible section definition in kas/core/init_sections.php, log out and open /kas/init on that installation. Accept the native section re-installation confirmation, wait for the login page, and sign in again before testing the menu and routes. Run initialization on each target KAS installation after deploying its section definitions. A non-menu Add page uses its Core file and explicit getPath option string and intentionally has no normal-menu record.

See How to Create a new KAS section for the required initialization workflow.

Example section, subsection and page names are placeholders. Use the names from your actual KAS section registration and the matching Core page filename.