Page 1 of 1

visitor A > template A, visitor B > template B

Posted: Thu Sep 18, 2008 8:49 am
by jack4ya
Hi,

title says it in short, but what I need:

When a regular user (A) visits the site they see a certain template, let's call it template A.
But when a registered user B visits the same site/pages, they see template B. (with added content blocks, different page layout and different print template)

This registered user may be a FEU (FrontEndUser maybe through FEU module), or just a BEU (BackEndUser an editor or whatever.)
It's not that important, because user B will only be 1 person...

I need registered user B to be able to view different content blocks and print the same page_id but in a different template then a regular user A.

Maybe like this:
• User B first sees template A, but like the {editif} tag, they see an extra link/button in the page (unlike user A).
When user B clicks the linke/button the page reloads with template B (and then they can print it)
• User B only sees template B (and then they can print it, so no step in between)
• (providing only user B with a different print template would not suffice, they need a different page template to, due to diff. content blocks, or maybe hiding them in css, so then: same template but use stylesheet A and stylesheet B approach??)
• better option you came up with :D

I already modified {editif} tag to reload the same page with the page_alias, this action is only provided to user B.
Now, how can I add a if/else load template thingie to it? Or is this a foolish approach?
^^^ I think so... I guess we can consider this a "foolish approach"...

Re: visitor A > template A, visitor B > template B

Posted: Thu Sep 18, 2008 9:00 am
by jack4ya
note to myself: http://forum.cmsmadesimple.org/index.php?topic=11689.0

***

I think I have it:

With custom content make content that is only shown to user B.
In this custom content area, display a stylesheet switcher form.
Then user B can switch to stylesheet B.
and then print...

However... in this way I would have to hide sensitive information with css, instead off not pulling it out the datebase all together...

Re: visitor A > template A, visitor B > template B

Posted: Thu Sep 18, 2008 9:19 am
by jack4ya
Or I can place the sensitive information in custom content also...

Re: visitor A > template A, visitor B > template B

Posted: Fri Sep 19, 2008 7:51 pm
by Pierre M.
Please view FEU+CC visual tutorial in the documentation.

Pierre M.

Re: visitor A > template A, visitor B > template B

Posted: Wed Sep 24, 2008 10:19 am
by jack4ya
Pierre M. wrote: Please view FEU+CC visual tutorial in the documentation.

Pierre M.
Didn't add any new things to my knowledge, but thanks anyway.

Re: visitor A > template A, visitor B > template B

Posted: Wed Sep 24, 2008 12:51 pm
by duclet
If your template is flexible enough, you can try the method mentioned here:

http://forum.cmsmadesimple.org/index.ph ... 28.15.html

However, you will obviously, need to change some of the stuff around. Instead of using the cookie to determine the CSS, you should use the user.

Re: visitor A > template A, visitor B > template B

Posted: Wed Sep 24, 2008 2:49 pm
by jack4ya
I've solved in a different way. Can't remember it now. (my mind is all over the place)  ::)
I'll come back to this quickly...

Re: visitor A > template A, visitor B > template B

Posted: Wed Sep 24, 2008 2:57 pm
by jack4ya
That was quick...

Quite easy solution I might say so, using FEU and CC
Works for me... I am able to present a different css and certain content_blocks only to specific users.

For the diff in stylesheets >

      {if $ccuser->loggedin() && $ccuser->memberof('specialuser') }
            {stylesheet name='shylesheetforspecialuser'}
      {else}
            {stylesheet}
       {/if}

For the diff in content blocks >

      {* Start Private Area *}
      {if $ccuser->loggedin() && $ccuser->memberof('specialuser') }
            {content block="blockonlyforspecialuser" assign="blockonlyforspecialuser"}
                  {if $blockonlyforspecialuser ne ""}
                        {$blockonlyforspecialuser}
                  {/if}
            {else}
       {/if}
      {* End Private Area *}