10 years ago
5
Topic

Hello,

I am trying to setup conditional states for a site form that is displayed as a module within a cotent page.

The jQuery code for the conditional state is not being rendered in the HTML of my page.

I suspect the problem lies with the template for the content type. I'm using template SD Simple Simon.

Does anybody know which piece of code in the seb_one template triggers the rendering of the conditional state code?

Any help would be much appreciated. Thank you

Gerhard

Get a VIP membership
4229 Posts
Kadministrator
10 years ago
1
Level 1

I jsut looked at SE simple code and I woudl say this tempalte si not 100% compatible withj joomla3, e.g. it uses JRegistry class which is gone in J3, also it does some transformations to output conditional fields. Try using Minima template instead.

10 years ago
0
Level 2

Hello Klas,

thank you for taking a look.

I'm using that template on a J! 2.5 site. So JRegistry class shouldn't be a problem.

Even if I change simple simon  index.php, lne 6+7 from

$cck = new SdRendering;
$cck->getInstance( $this->template );

to

$cck    =    CCK_Rendering::getInstance( $this->template );

which is the original code from seb_one index.php,

it doesn't change the behaviour. Which is strange because then the template is not using the custom class "SdRendering" at all.

Anyways, I will try minima template.

10 years ago
1
Level 1

I tried Minima template but still the conditional JS code is not being rendered. Why is that?

Code for validation is there in my HTML.

Any pointers towards a solution would be much appreciated. Thank you.

10 years ago
0
Level 2

Same result with seb_one template and no template/position overrides in place.

10 years ago
0
Level 1

Found the problem. Was my own fault.

I'm using  /templates/seb_one/fields/markup.php to customize my field output.

In the original _markup.php there are these lines

    // Computation
    if ( isset( $field->computation ) && $field->computation ) {
        $cck->setComputationRules( $field );
    }
    // Conditional
    if ( isset( $field->conditional ) && $field->conditional ) {
        $cck->setConditionalStates( $field );
    }

They where missing in my markup.php. After pasting them there, conditional code is now being rendered in the HTML.

Get a Book for SEBLOD