Jump to content


[Snippet] ListMenu


  • You cannot reply to this topic
190 replies to this topic

#181 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 28 January 2009 - 02:41 PM

View Postd3signr, on Jan 28 2009, 09:20 AM, said:

Thanks for this seems like to good addition. Couple of questions though.

Can i run two separate ListMenu's on the same page? (in theory i know i can), I'm just not sure how I would keep separate the different menu items. You see one menu will be the main site nav and the other a specific menu for displaying events for each day of the week. <<< SNIP >>>

Look here

There are probably more topics which cover this as well...

#182 Opal

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 21 March 2009 - 11:11 PM

I've seen references to authListMenu, Ralph's modified version of ListMenu with authentication, but post-forum-upgrade, the references to the snippet do not work.
Can anyone point me at the subversion, please?

#183 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 22 March 2009 - 01:07 AM

It's only a few lines of additional code added to the original listMenu, using the checkPermissions API, implementation is described here.

#184 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 31 March 2009 - 08:40 AM

Authentication checks can be implemented in this menu snippet like this:

Add the authenticate field to the getActiveChildren()- approx line 157:
and rename the $childrenList to $childrenListOrig to enable the ability to loop through results prior to returning them...

Quote

for($geneCount=0;$geneCount < count($geneology);$geneCount++){[/code]
$childrenListOrig = $etomite->getActiveChildren($geneology[$geneCount], $sortString, null,'id, pagetitle, longtitle, parent, isfolder, description,authenticate');
Then add a loop to check each page for authentication... (select the method that returns the results that you require)...

This will return ONLY pages that are authenticated WHEN the user is logged in...
foreach($childrenListOrig as $childListItem){
 if (($childListItem['authenticate'] == 1) && 
	 ($etomite->checkPermissions($childListItem['id']) == true)
	)
	{ 
	$childrenList[] = $childListItem;//build an array of docs to show
	}
}
This will return ALL pages but BLOCK PAGES that are authenticated when the user is NOT logged in.

foreach($childrenListOrig as $childListItem){
 if (($childListItem['authenticate'] != 1) || 
	 ($childListItem['authenticate']== true ]
	   && $etomite->checkPermissions($childListItem['id']) == true)
	)
	{ 
	$childrenList[] = $childListItem;//build an array of docs to show
	}
}

Now this hack assumes that
1) you have a method of authenticating through the front-end of the site like authenticate_visitor snippet.
2) that you have some sort of permissions management turned on in the site config, (whether they be document group permissions or simple visitor permissions)
3) that you have etomite versions 1.0 + (with the latest version of the checkPermissions API)

This is the source file with the second option (all pages with authenticated ones hidden (unless logged in) enabled:

Attached File  listMenuAuth.txt   8.54K   4 downloads

#185 Opal

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 31 March 2009 - 11:21 AM

A HUGE thank you for Cris, who bailed me out of my array ineptitude this morning so I can ship this website with the required menu security!

#186 Psycho Mantis

    Etomite Forum Fan

  • Member
  • Pip
  • 113 posts

Posted 14 May 2009 - 03:47 PM

Hi,

I'd like to highlight (via CSS class) the parent page of the current page.

Like this:
  • parent page 1 <-- highlight
    • subpage 1/1
    • subpage 1/2 <-- current page
  • parent page 2
  • ...

Is there a way to check, if the child page of a parent folder is the current page and if so, add a specific style to this list item?

Many thanks in advance!

#187 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 15 May 2009 - 06:04 AM

Why don't any of the default styles generated do the job?
// .LM_expanded	 expanded menu item with children
// .LM_collapsed	menu item with childen, but not expanded
// .LM_endPage	  menu item with children


#188 stp69

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 15 May 2009 - 08:10 PM

Hello & good evening

i need help for a design by use this snippet:

I use a three column Design. In the left Sidbar I should like to show only the Documents well-placed in the root, eg:

- Home
- Folder 1
- Dokument-1
- Document-2
- Folder 2
- Dokument-4
- Dokument-5
- Folder 3

So i call [!ListMenu!] in the Template

and so far...

in the right Sidebar i should like to show the children Documents from the active Document, eg the Document Folder-1 has the Children (Link-1, Link-2 and Document-15). If this Document active, the right Sidebar show:

-Link-1,
-Link-2,
-Document-15

So i call [!ListMenu?LM_levels=-1!] in the Template for the right Menu

I dont need the Children in the left Sidebar too. Are there no children, the Sidebar also is empty.


What must i do to resolve this problem?

Edited by stp69, 15 May 2009 - 08:19 PM.


#189 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 16 May 2009 - 02:58 AM

The new default template uses 2 menus like this, they are ListGlobal and ListChildOrSibs. Unless I'm reading your question wrong - you should check them out.

#190 stp69

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 16 May 2009 - 07:46 AM

View Postdarren, on May 16 2009, 03:58 AM, said:

The new default template uses 2 menus like this, they are ListGlobal and ListChildOrSibs. Unless I'm reading your question wrong - you should check them out.

Darren, thats work fine :) Thank you. I think i must learn english much more B) you reading well, i'm writing wrong...

#191 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 16 May 2009 - 09:00 PM

:D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users