Print_r not working

@cheesegrits

Could you tell me why code below not working on my site?
echo "<pre>";

$search_form = $this->groups['Search form'];
$search_form_elements = $search_form->elements;
print_r($this->$search_form_elements);

echo "</pre>";
 
As @troester explained in this post:

http://fabrikar.com/forums/index.php?threads/form-customization.45433/#post-234114

... by default we use Bootstrap v2, which is what ships with J! and is used in the protostar template. If you use a Bootstrap v3 template, you would have to load the overrides referenced in that post.

But as you are using Protostar, it is Bootstrap v2, which means using the v2 fluid grid classes, which use the spanX classes, not the col-md-X.

http://getbootstrap.com/2.3.2/scaffolding.html#gridSystem

-- hugh
 
I just had a look, and yes, you loaded a "compatibility pack", but all that does is create spanX classes, and other bs2 specific stuff, so bs2 CSS will work on a bs3 site. That's what "compatibility pack" means. But your template is still effectively bs2. There is no bs3 being loaded. So col-md-X still won't work.

-- hugh
 
@cheesegrits , it was helpful. One more question about distance between fields.
I would to change this css class. But it is overriding by joomla bootstrap. How it is possible to make workaround with fabrik styles.

.row-fluid .span3 {
width: 12%;
}
 
Well, I really wouldn't try overriding bootstrap classes. Although if you really want to, you'll probably have to add !important to the values, to force them to override the CSS inheritance from the main bootstrap classes.

In the out-of-box Fabrik bootstrap form template, there is a fabrikElementContainer div that acts as a wrapper for the entire element/label, which has the spanX and the element name as classes, so you can override for either all elements or individual elements, without touching the bootstrap CSS. But you seem to have removed that, and just have a div span3, with no way of selecting it.

You also need to be careful when modifying Fabrik templates, and try and retain the basic class structure we use, as often the Javascript on elements relies on certain classes being there. So the main "wrapper" container (usually a div) should keep the fabrikElementContainer and fb-el-<yourtable___yourelement> classes.

-- hugh
 
If you want to override original (bootstrap) classes for special cases you should use more specific selectors.

Not only elements have "wrappers" also the form has a form tag with id=form_X_Y (X=formID, Y=rowID).
X and Y are correctly set if you are using custom_css.php

See the WIKI for how to use form template's custom_css.php
So something like
#$form .row-fluid .span3 {
width: 12%;
}
 
If you want to override original (bootstrap) classes for special cases you should use more specific selectors.

Not only elements have "wrappers" also the form has a form tag with id=form_X_Y (X=formID, Y=rowID).
X and Y are correctly set if you are using custom_css.php

See the WIKI for how to use form template's custom_css.php
So something like
#$form .row-fluid .span3 {
width: 12%;
}

Does it should work without setting X and Y?
#$form .row-fluid .span3 {
width: 12%;
}

I have set up span2. It is more appropriate class. And It has some other specific of rendering. So now I need to decrease width to 80%.
Now it looks like below. I wonder to know why it is not working there.

#$form .row-fluid .span2 {
width: 80%;
}
 
What have you done in custom_css.php? Seems you've changed something in the original code.
It's generating
# .row-fluid .span2{
width:80%; !important
}
so $form is not set (as it is in the original custom_css.php code)
 
If you look at what is actually being generated in your custom_css.php (use dev tools in your browser, look at the source of the file), you'll see the $form isn't getting assigned:

Code:
# .row-fluid .span2{
width:80%; !important
}

When you copied and modified your custom CSS file, did you remove the code from the start that sets up $form?

Code:
header('Content-type: text/css');
$c = (int) $_REQUEST['c'];
$view = isset($_REQUEST['view']) ? $_REQUEST['view'] : 'form';
$rowid = isset($_REQUEST['rowid']) ? $_REQUEST['rowid'] : '';
$form = $view . '_' . $c;
if ($rowid !== '')
{
    $form .= '_' . $rowid;
}

-- hugh
 
If you look at what is actually being generated in your custom_css.php (use dev tools in your browser, look at the source of the file), you'll see the $form isn't getting assigned:

Code:
# .row-fluid .span2{
width:80%; !important
}

When you copied and modified your custom CSS file, did you remove the code from the start that sets up $form?

Code:
header('Content-type: text/css');
$c = (int) $_REQUEST['c'];
$view = isset($_REQUEST['view']) ? $_REQUEST['view'] : 'form';
$rowid = isset($_REQUEST['rowid']) ? $_REQUEST['rowid'] : '';
$form = $view . '_' . $c;
if ($rowid !== '')
{
    $form .= '_' . $rowid;
}

-- hugh
Yes, it was removed accidentally.

Also, I would to change the height of the element. Why it is not implementing on the field?

.fb_el_search_form___arrival_date .span2 {
height:40px;
}

.fb_el_search_form___arrival_date .span2 {
line-height:40px;
}
 
As @cheesegrits said: you shouldn't change the Fabrik stucture in your custom templates.

Obviously you have removed the surrounding div with the element container, so you don't have a fb_el_xxx class (nor a fabrikElementContainer or plg-date class, which pretty sure will break some JS running on your form).
This is how it looks with original bootstrap
upload_2016-11-6_20-27-28.png

and this with your custom template
upload_2016-11-6_20-28-11.png
 
Template customization is not simple, you need to be familiar with PHP, have a good understanding of CSS and the Bootstrap framework, and some experience with Fabrik. That's why we offered to design this for you.

I don't understand what you are asking with this:

Also, if I need to exclude default form from the default.php is it correct to delete fieldset block of code?

What do you mean by "the default form"?

-- hugh
 
under default form I mean the set of form`s fields which are rendering by default, untill we make changes to the default.php.
By default they are arranging vertically.
 
Code:
<fieldset class="<?php echo $group->class; ?>" id="group<?php echo $group->id;?>" style="<?php echo $group->css;?>">
        <?php
        if ($group->showLegend) :?>
            <legend class="legend"><?php echo $group->title;?></legend>
        <?php
        endif;

        if (!empty($group->intro)) : ?>
            <div class="groupintro"><?php echo $group->intro ?></div>
        <?php
        endif;

        /* Load the group template - this can be :
         *  * default_group.php - standard group non-repeating rendered as an unordered list
         *  * default_repeatgroup.php - repeat group rendered as an unordered list
         *  * default_repeatgroup_table.php - repeat group rendered in a table.
         */
        $this->elements = $group->elements;
        echo $this->loadTemplate($group->tmpl);

        if (!empty($group->outro)) : ?>
            <div class="groupoutro"><?php echo $group->outro ?></div>
        <?php
        endif;
    ?>
    </fieldset>
Also I refered on this part of code.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top