Page 1 of 1

Reduce white space to left of Xataface main data 'frame'

PostPosted: Fri Mar 27, 2009 10:55 pm
by fredly
Hi,

I'm new to Xataface, but have got a basic XF site up and running and am now trying to make some cosmetic changes to positioning of layout elements. Specifically, I want to reduce the rather large (5cm on my screen) left-hand 'margin' space between the left edge of the browser window and the XF record 'frame' (below the 'table tabs' bar). I wonder how do I do this?

I have tried adding a custom stylesheet (called 'styles.css' and based on some elements contained in the 'plone.css' file in the XF directory) to the top level of my application directory. The stylesheet contains the following items (I've reduced the max-width attribute to 35mm down from 175mm):

....

#main_table {
clear: both;
}

#main_table #left_column {
max-width: 35px;
padding: 1em;
}

#main_table #main_column {
}
....

I also added some code to myApplicationDelegate.php file below the code I already had there (to login users). The code I added was suggested by Steve (Hannah) in an earlier post:

....
function block__custom_stylesheets(){
$styles_path = DATAFACE_SITE_URL;
if ( $styles_path{strlen($styles_path)-1} != '/' ) $styles_path .= '/';
// If there was no trailing slash to the styles path, we add one.
$styles_path .= 'styles.css';
echo <<
END;
return true;
}
...

But this leads to an error when I try to login to my site:
'Parse error: syntax error, unexpected T_SL in .... ApplicationDelegate.php on line 30' (the line with 'echo' I think).

I am stuck now and would really appreciate some help.

Thanks...

Fred

PS: I also want to reduce the span of the sidebar area, which I guess might involve a similar method to the above, but I'm not sure about this either.

PostPosted: Thu Apr 02, 2009 7:01 pm
by shannah
What is on line 30? (the line of the error). Looks like it's probably a syntax error - easy to fix if I knew what was there.

-Steve

PostPosted: Thu Apr 02, 2009 8:05 pm
by fredly
Hello Steve,

Line 30 is the 'echo <<' statement. Here's the code I have in my ApplicationDelegate.php file (after the function block for logging in users). I assume only ONE ApplicationDelegate.php file is required and everything goes in that.

Thanks again,

Fred
....
function block__custom_stylesheets(){
$styles_path = DATAFACE_SITE_URL;
if ( $styles_path{strlen($styles_path)-1} != '/' ) $styles_path .= '/';
// If there was no trailing slash to the styles path, we add one.
$styles_path .= 'styles.css';
echo <<
END;
return true;
}
....

PostPosted: Thu Apr 02, 2009 8:51 pm
by shannah
I'm not sure if PHPBB is stripping out some of your code, but
echo <<
is a syntax error.

The correct syntax would be
Code: Select all
echo <<<END
your output here ...
END;


END; must be on a line of its own too (not indented).

-Steve

White space problem solved

PostPosted: Sun Apr 05, 2009 6:07 pm
by fredly
Thanks for that suggestion, Steve. I fixed the PHP error by changing the code in my application's delegate class to...
...

function block__custom_stylesheets(){
echo '<link>';
}

....

For those who might be interested, the code I put in my styles.css file that removed the left-side white space (and also the left sidebar column inside the VIEW tab frame) is:
Code: Select all
table#main_table td#left_column {
   width: 0px;
}

div.dataface-sections-left {
   display: none;
   /*float: left;*/
   /*width: 225px;*/
   padding-top: 10px;
}


td#dataface-sections-left-column {
   width: 10px;
   /*width: 225px;*/
}

So this problem is now sorted.

Fred