Welcome, Guest. Please login or register.
Did you miss your activation email?
23 Jul 2008, 14:12

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: CustomContent Question  (Read 621 times)
0 Members and 1 Guest are viewing this topic.
WhizZ
Forum Member
*

Karma: 0
Offline Offline

Posts: 4


« on: 10 May 2008, 03:51 »

Hi,

I got a queston about the CustomContent module.

It's fully working but 1 thing I don't understand is how to set the group of people that are allowed to see the content.
I can't see the content but when i'm logged in, I still can't see it..

Here's the code:
 ---------------------------------------------
{cms_module module=CustomContent}

{if $customcontent_loggedin }
  Welcome {$customcontent_loginname}

Here is my page code

{else}
 you're not allowed to see this content
{/if}
 ---------------------------------------------

Where do i put the groups from FrontEndUser that are allowed to see it ?

Thx anyway.
Logged
vilkis
Forum Member
*

Karma: 1
Offline Offline

Posts: 90

Location: Lithuania


Programuotojas iš pašaukimo


« Reply #1 on: 10 May 2008, 05:28 »

Code below should work. Don't forget to replace GROUPNAME with name of your FU group in code below.

Code:
{if $customcontent_loggedin}
    {if $customcontent_memberof_GROUPNAME}
        Welcome {$customcontent_loginname}
       
        Here is my page code
    {/if}
{else}
    you're not allowed to see this content
{/if}
Logged

For a warrior, to be inaccessible means that he touches the world around him sparingly. And above all, he deliberately avoids exhausting himself and others. He doesn't use and squeeze people until they have shriveled to nothing, especially the people he loves.
WhizZ
Forum Member
*

Karma: 0
Offline Offline

Posts: 4


« Reply #2 on: 12 May 2008, 04:18 »

Thank you very much Wink
Logged
WhizZ
Forum Member
*

Karma: 0
Offline Offline

Posts: 4


« Reply #3 on: 12 May 2008, 14:08 »

It's still not working  Sad

I got the code

{if $customcontent_loggedin}
    {if $customcontent_memberof_Admin}
        Welcome {$customcontent_loginname}
       
        Here is my page code
    {/if}
{else}
    you're not allowed to see this content
{/if}

and i still can't see it ?, I use the groups of frontenduser module.

used serveral groups, with serveral accounts, nothing works.

any ideas ?

thx anyway Smiley
Logged
calguy1000
Dev Team Member
Power Poster
*****

Karma: 139
Offline Offline

Posts: 3884

Location: Calgary, Canada



WWW
« Reply #4 on: 12 May 2008, 14:16 »

{if $ccuser->memberof('blah'}}
  You are logged in, and a member of the 'blah' group
{else}
  You are either not logged in, or your not a member of the appropriate group of users
{/if}

It's in the CustomContent help.
Logged

WhizZ
Forum Member
*

Karma: 0
Offline Offline

Posts: 4


« Reply #5 on: 12 May 2008, 15:06 »

Thank you, didn't find it myself.

There was only a little typo in the code

{if $ccuser->memberof('blah'}}
 
Must be

{if $ccuser->memberof('blah')}
Logged
vilkis
Forum Member
*

Karma: 1
Offline Offline

Posts: 90

Location: Lithuania


Programuotojas iš pašaukimo


« Reply #6 on: 13 May 2008, 13:11 »

But be careful: WYSIWYG (FCKeditor at least) replaces > with > when one saves page in non-html mode  and script above stops working.
So it is possible, that I have made a minor changes in CustomContent  module  and code that I wrote above works for me. It is safe in respect of WYSIWYG.
Logged

For a warrior, to be inaccessible means that he touches the world around him sparingly. And above all, he deliberately avoids exhausting himself and others. He doesn't use and squeeze people until they have shriveled to nothing, especially the people he loves.
calguy1000
Dev Team Member
Power Poster
*****

Karma: 139
Offline Offline

Posts: 3884

Location: Calgary, Canada



WWW
« Reply #7 on: 13 May 2008, 13:13 »

if you're putting logic into the page content you shouldn't be using wysiwygs.  wysiwygs are for customers not website designers/developers.
Logged

vilkis
Forum Member
*

Karma: 1
Offline Offline

Posts: 90

Location: Lithuania


Programuotojas iš pašaukimo


« Reply #8 on: 13 May 2008, 14:18 »

But often content of pages (including protected pages) are modified by peoples without knowledge of html (customers). I think it is initial idea of CMS. Let say a designer have included logic into the page and saved it correctly. But a customer  have to change the the content of that page and do it in wysiwyg mode. In this way the script that includes simbol ">" and similar stop to work. It is not good.
Logged

For a warrior, to be inaccessible means that he touches the world around him sparingly. And above all, he deliberately avoids exhausting himself and others. He doesn't use and squeeze people until they have shriveled to nothing, especially the people he loves.
calguy1000
Dev Team Member
Power Poster
*****

Karma: 139
Offline Offline

Posts: 3884

Location: Calgary, Canada



WWW
« Reply #9 on: 13 May 2008, 14:20 »

if designers are putting logic into page content that customers will be editing, then the designer should probably re-think his template.

Users mess everything up.  it's best to keep the functionality away from the content.  And that's what CMS allows you to do.
Logged

vilkis
Forum Member
*

Karma: 1
Offline Offline

Posts: 90

Location: Lithuania


Programuotojas iš pašaukimo


« Reply #10 on: 13 May 2008, 14:39 »

I agree totally.  So code

{if $ccuser->memberof('blah')}
  You are logged in, and a member of the 'blah' group
{else}
  You are either not logged in, or your not a member of the appropriate group of users
{/if}

is not good solution for those pages that is customer editable.

Logged

For a warrior, to be inaccessible means that he touches the world around him sparingly. And above all, he deliberately avoids exhausting himself and others. He doesn't use and squeeze people until they have shriveled to nothing, especially the people he loves.
calguy1000
Dev Team Member
Power Poster
*****

Karma: 139
Offline Offline

Posts: 3884

Location: Calgary, Canada



WWW
« Reply #11 on: 13 May 2008, 14:54 »

sure it is, but you have to put that into the template, and use multiple content blocks.

i.e:
{if $ccuser->memberof('blah')}
   {content block='Private Content'}
{else}
   {content block='Public Content'}
{/if}

Then the customer will have two wysiwyg enabled text areas to fill in when editing the content of a page, and the logic is eperated from the content.
Logged

vilkis
Forum Member
*

Karma: 1
Offline Offline

Posts: 90

Location: Lithuania


Programuotojas iš pašaukimo


« Reply #12 on: 13 May 2008, 14:59 »

SUPER!!! It is the solution.
Logged

For a warrior, to be inaccessible means that he touches the world around him sparingly. And above all, he deliberately avoids exhausting himself and others. He doesn't use and squeeze people until they have shriveled to nothing, especially the people he loves.
Pages: [1]
Print
Jump to: