Template look change based on user group

Author Message

Noicokuna Niemoge

Tuesday 17 February 2009 12:43:33 am

Hi;

I wonder if this can be done: I'd like to create different look of forum posts and page comments, depending on user group. For example, admin answers would be highlighted with different background color, etc.

Can this be done in template language? How would you do it? I think the "if" statement should be used, but that's all what I know. :)

Shiki soku ze ku...

Michael Fürst

Tuesday 17 February 2009 3:32:36 am

Hi,

I think that you can get the user group by fetching the user object assigned to a message. Just have a look at the "fetch" functions in the manual.

Regards,
Mike

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:34:12
Script start
Timing: Jan 19 2025 00:34:12
Module start 'layout'
Timing: Jan 19 2025 00:34:12
Module start 'content'
Timing: Jan 19 2025 00:34:12
Module end 'content'
Timing: Jan 19 2025 00:34:12
Script end

Main resources:

Total runtime0.0305 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0079 588.0469152.6406
Module start 'layout' 0.00790.0037 740.687539.4766
Module start 'content' 0.01150.0167 780.164189.3672
Module end 'content' 0.02830.0021 869.531330.3047
Script end 0.0304  899.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003210.4449140.0002
Check MTime0.00123.9503140.0001
Mysql Total
Database connection0.00103.354110.0010
Mysqli_queries0.004414.425830.0015
Looping result0.00000.052410.0000
Template Total0.00175.410.0017
Template load0.00092.894110.0009
Template processing0.00082.517010.0008
Override
Cache load0.00061.998210.0006
General
dbfile0.00041.414680.0001
String conversion0.00000.029740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs