Error in Custom_Css.php

teoyh

Member
I happen to be checking my php error log and i notice there are a lot of this error ;

PHP Parse error: syntax error, unexpected '.' in ...www\components\com_fabrik\views\form\tmpl\bootstrap\custom_css.php on line 2

This is what it is in the custom_css.php file which is the default i think

<?php
.fabrikForm label.btn.active.btn-danger {
background-color: red;
}
.fabrikForm label.btn.active.btn-success {
background-color: blue;
}
.fabrikForm label.btn:not(.active) {
background-color: lightgray;
}
.fabrikUploadDelete button {
display:none
}

Can someone help me with this thank you
 
Well, that's not PHP. :)

You have started your file with a <?php tag, but then haven't written PHP, just CSS.

If you look at the custom_css_example.php, you'll see it starts with some PHP, then echoes the actual CSS, using variables set up in the PHP.

Code:
<?php
/**
 * Default Form Template: Custom CSS
 *
 * @package     Joomla
 * @subpackage  Fabrik
 * @copyright   Copyright (C) 2005-2016  Media A-Team, Inc. - All rights reserved.
 * @license     GNU/GPL http://www.gnu.org/copyleft/gpl.html
 * @since       3.0
 */

/**
 * If you need to make small adjustments or additions to the CSS for a Fabrik
 * template, you can create a custom_css.php file, which will be loaded after
 * the main template_css.php for the template.
 *
 * This file will be invoked as a PHP file, so the view type, form ID and row ID
 * can be used in order to narrow the scope of any style changes.  A new form will
 * have an ID of "form_X" (where X is the form's numeric ID), while edit forms (for existing
 * rows) will have an ID of "form_X_Y" (where Y is the rowid).  Detail views will always
 * be of the format "details_X_Y".
 *
 * So to apply styles for (say) form ID 123, you would use ...
 *
 * #form_123, #form_123_$rowid { ... }
 *
 * Or to style for any form / row, it would just be ...
 *
 * #$form { ... }
 *
 * See examples below, which you should remove if you copy this file.
 *
 * Don't edit anything outside of the BEGIN and END comments.
 *
 * For more on custom CSS, see the Wiki at:
 *
 * http://www.fabrikar.com/forums/index.php?wiki/form-and-details-templates/#the-custom-css-file
 *
 * NOTE - for backward compatibility with Fabrik 2.1, and in case you
 * just prefer a simpler CSS file, without the added PHP parsing that
 * allows you to be be more specific in your selectors, we will also include
 * a custom.css we find in the same location as this file.
 *
 */

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;
}
echo <<<EOT

/* BEGIN - Your CSS styling starts here */

#$form .foobar {
    display: none;
}

#form_123 .foobar, #form_123_$rowid .foobar {
    display: none;
}

/* END - Your CSS styling ends here */

EOT;

... so, either do what it say in the comments, and put your CSS between the BEGIN and END comments. Or remove the <?php at the start of your file.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top