Is dropdown menu for sub pages possible?

qwerious

Avatar: qwerious

2008-08-18 18:27

I'd like to make a menu like this one http://qrayg.com/learn/code/cssmenus/ with drop downs to show sub=pages. Is it possible to make any of the menus so that they have a nested output of whole page structure.

What I think I need to have as a output is something like:

<ul>
<li>...
<ul>
<li>...</li>
<li>...</li>
etc.
</ul></li>
<li>...
<ul>
<li>...</li>
<li>...</li>
etc.
</ul></li>
etc
</ul>

» Quick.Cms v1.x

Makaron

Avatar: Makaron

2008-08-19 13:11

Use new version of Quick.Cms where You have this structure (<ul>, <li>) connected with menu. And in this case You shouldn't have problems.

qwerious

Avatar: qwerious

2008-08-19 21:56

Thanks Makaron
I am now looking at V2.1 but can only see the sub pages for the selected page. For a 'full site' dynamic menu need to see the <ul><li> etc code for the whole site. A bit like the sitemap I supppose. Is this possible?

Makaron

Avatar: Makaron

2008-08-20 09:20

You can edit file core/pages.php and find this lines:

if( $iDepthLimit $iDepth && ( $iPageCurrent == $iPage || isset( $this->aPageParents[$iPage] ) ) ){
        
#if( $iDepthLimit > $iDepth ){
          
$this->generateMenuData$iType$iPageCurrent$iDepthLimit$iDepth 1$iPage );
        }


and change it to:

$this->generateMenuData$iType$iPageCurrent$iDepthLimit$iDepth 1$iPage );


After that submenus will be displaying also in menu..

dstar

Avatar: dstar

2009-04-01 16:30

How can this be done in V2.3. I don't see the mentioned line of code in this version. Is this correct?

Thank you!

dstar

dstar

Avatar: dstar

2009-04-02 11:18

I have found the code that needs to be excluded to show all subpages on the website. I have included it below. Maybe it helps. Thanks!


/**
* Return variable with menu
* @return null
* @param int $iType
* @param int $iPageCurrent
* @param int $iDepthLimit
* @param int $iDepth
* @param int $iPageParent
*/
function generateMenuData( $iType, $iPageCurrent, $iDepthLimit, $iDepth = 0, $iPageParent = null ){
if( !isset( $this->mData ) ){
$aData = $this->aPagesParentsTypes[$iType];
}
else{
if( isset( $this->aPagesChildrens[$iPageParent] ) )
$aData = $this->aPagesChildrens[$iPageParent];
}

if( isset( $aData ) ){
foreach( $aData as $iKey => $iPage ){
$this->mData[$this->aPages[$iPage]['iPageParent']][$iPage] = true;

/***** BY EXCLUDING LINE BELOW - ALL SUBPAGES ARE LISTED AT THE SAME TIME ******/

//if( $iDepthLimit > $iDepth && ( $iPageCurrent == $iPage || isset( $this->aPageParents[$iPage] ) || DISPLAY_EXPANDED_MENU === true ) ){
$this->generateMenuData( $iType, $iPageCurrent, $iDepthLimit, $iDepth + 1, $iPage );
//}
} // end foreach
}
} // end function generateMenuData

dstar

Back to top
about us | contact