67 Posts
Mario Adrian
9 years ago
2
Topic

Hello, is it possible to override the template for group x?

i tried to override through usual method but it's not working

any suggestion?

P.S: i need to override just to use the jtext language and wrapping the form with div for easier css

Get a Book for SEBLOD
67 Posts
Mario Adrian
9 years ago
0
Level 1

i decided to just override the core and add "jtext" everytime it echo label

also, i cant find the one that echo label for the default field

do you know where i can find the php that echo this?
251 Posts
Viktor Iwan
8 years ago
0
Level 1

Wow.. 1 year without reply... @Klas, hopefully you have better answer...

If you're working with Intro, Content, OR List.. you probaby like this manual:  https://www.seblod.com/resources/tutorials/calling-field-x-and-group-x-content-in-an-override

BUT, i see that you're referencing on Site/Admin Form, than it's little bit different story... One of my approach is altering the output instead of  tweaking the process (Desclaimer, i don't fully understand about how groupX render process in technical perspective).

So, here's an example of mine:

I would like a certain user group get their select list disabled... my approach is to eliminate/erase all-non selected option. Code goes something like this:

$content=$cck->renderField( 'termin_bayar' );
$pattern = '/<option value="[0-9]*">.*<\/option>/i';
$replacement = '';
if (key($user->groups)==10){
	echo preg_replace($pattern, $replacement, $content);
}else{
	echo $content
}
$user object is automatically load within seblod template override, no need to initial this jUser object
Get a Book for SEBLOD