FEU/Custom Content - Hide/show menu's

A place to make for-pay "CMS made simple" job offerings
Post Reply
User avatar
jkessel
New Member
New Member
Posts: 8
Joined: Thu Jul 16, 2009 12:03 am

FEU/Custom Content - Hide/show menu's

Post by jkessel »

Need help on menuing

I want to hide all menu items from non-logged in users except those marked with alias "public_"

I want to show menu items with alias "priv_' to ANY logged in users of any group

I want to show menu items with alias "inv_" only to members of FEU group "investors" - therefore "investors" would still access the other menu items as they are logged in users!

I also want to restrict searching based upon the same FEU group content restrictions

I've tried searching the forums but don't see a solutions which matches this issue

Came close but can't get this to work right

Code: Select all

{if $ccuser->loggedin() && $ccuser->memberof('public')}
       {if $ccuser->memberof('investors')}
        	 {menu template='cssmenu.tpl' excludeprefix='priv_'}
       {else}
        	 {menu template='cssmenu.tpl' excludeprefix='inv_'}
       {/if}
  {else}
         {menu template='cssmenu.tpl' excludeprefix='public_'}
{/if}
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FEU/Custom Content - Hide/show menu's

Post by jmcgin51 »

how about this:
{if $ccuser->loggedin()} && !$ccuser->memberof('investors') //if the user is logged in and is NOT a member of the "investors" group
      {menu template='cssmenu.tpl' includeprefix='public_,priv_'} //include only menu items with public_ and priv_ prefixes
{else if $ccuser->loggedin() && $ccuser->memberof('investors')} //if the user is logged in and IS a member of the "investors" group
       {menu template='cssmenu.tpl' includeprefix='public_,priv_,inv_'} //include public_, priv_, AND inv_ menu items
{else} //in any other case
       {menu template='cssmenu.tpl' excludeprefix='priv_,inv_'} //show the menu without the priv_ and inv_ items (this assumes you only have three types of prefixes, so public_ is the only one left to be shown)
{/if}
There are probably ways to streamline this or make it more efficient, but I think this will get you what you want.

As far as restricting searchability, I can't give you a good answer there.  You can turn on/off allowing a page to be searched, but if you turn it on and a user is not authorized to view the page, I think the page content can still show up in search results.  When the user tries to access the page, he won't be able to, but it's still a loophole that can allow an unauthorized user to view some restricted content.  Hopefully this will be addressed in a future update.
Last edited by jmcgin51 on Wed Jul 29, 2009 2:55 am, edited 1 time in total.
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: FEU/Custom Content - Hide/show menu's

Post by applejack »

For the search results if say all private pages have a parent or root alias of say private then you could filter the search results based upon a match with the URL

Website Design & Production
http://www.applejack.co.uk
User avatar
jkessel
New Member
New Member
Posts: 8
Joined: Thu Jul 16, 2009 12:03 am

Re: FEU/Custom Content - Hide/show menu's

Post by jkessel »

Thanks JM

The code had a couple of syntax errors in it and the one I can't resolve it a smarter compilerr error for the last {else}

so I ended up with this

Code: Select all

{if $ccuser->loggedin() && !$ccuser->memberof('investors')}  {*if the user is logged in and is NOT a member of the "investors" group*}
          {menu template='cssmenu.tpl' includeprefix='public_,priv_'} {*include only menu items with public_ and priv_ prefixes*}
{else if $ccuser->loggedin() && $ccuser->memberof('investors')} {*if the user is logged in and IS a member of the "investors" group*}
        {menu template='cssmenu.tpl' includeprefix='public_,priv_,inv_'} {*include public_, priv_, AND inv_ menu items*}
{*in any other case*}
        {menu template='cssmenu.tpl' excludeprefix='priv_,inv_'} {*show the menu without the priv_ and inv_ items (this assumes you only have three types of prefixes, so public_ is the only one left to be shown)*}
{/if}
Can I PM you an admin login to get this resolved? I don't mind throwing you some $
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FEU/Custom Content - Hide/show menu's

Post by jmcgin51 »

sure - go ahead
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FEU/Custom Content - Hide/show menu's

Post by jmcgin51 »

tried to PM you back, but it says your PM box is full...
Post Reply

Return to “Help Wanted (commercial)”