Page 1 of 1

Template troubles

PostPosted: Wed Sep 15, 2010 1:04 am
by cantlep
Hi,

I'm using some templates to display parts of a page horozintally rather than vertically. This works really well...Yet another great Xataface feature...

I do have a couple of issues though..

1) How can I get the plone.css to be honoured when using the templated sections from within a relationship? I've tried adding it in a number of ways to no avail. I thought it might inherit it from the main page (like it does when being used without a relationship - but it doesn't). Any ideas?

2) As I've now overridden parts of what the fields.ini sections say, the red squares to indicate mandatory fields have disappeared. Any ideas how I can get them back or what the HTML/Css used to generate them is?

Thanks

Paul

Re: Template troubles

PostPosted: Fri Sep 17, 2010 11:23 am
by shannah
Hard to comment. It should *always* honor the plone.css file if as long as the plone.css file is included in the page. Check to make sure that the plone.css file is still included.

-Steve

Re: Template troubles

PostPosted: Sat Sep 18, 2010 11:48 am
by cantlep
In the view source option of the browser, the plone.css is still referenced so I can't understand why the fonts are massive in the relationship table. This is only when using templates.
Any ideas?

Thanks

Paul

Re: Template troubles

PostPosted: Sun Sep 19, 2010 11:33 am
by shannah
It's hard to say from this vantage point. There's a problem somewhere but it would require hands o investigation.

Re: Template troubles

PostPosted: Tue Sep 21, 2010 2:35 pm
by cantlep
Yeah, I think you're right. If I wanted to input a css in the template itself (just to see what'd happen), how would I add it? Just as per usual within the <HTML> tags?

Re: Template troubles

PostPosted: Tue Sep 21, 2010 2:46 pm
by shannah
You can either use a block (e.g. custom_stylesheets), or you can add a <link> tag directly in your templates.

Re: Template troubles

PostPosted: Fri Sep 24, 2010 1:55 pm
by cantlep
Hiya,

I added this into the template file
Code: Select all
<link rel="stylesheet" type="text/css" href="dataface/plone.css"/>

and although it is shown in the page source, it was ignored.

I then added this instead
Code: Select all
<font face="calibri" size="2">

Which is honoured. However, because the CSS is being ignored. The tab sizes are still massive and the red squares to indicate a mandatory field are no longer visible.

Is this a bug, can you re-create?

Thanks

Paul

Re: Template troubles

PostPosted: Fri Sep 24, 2010 2:28 pm
by shannah
I can't reproduce this issue. It is likely a problem with pointing to the wrong url. You'll need to troubleshoot this one a bit.
Note that if the tabs are there are all, it probably means the stylesheet is getting included ... only some rules are being overridden or not being picked up.

You're using a custom template, or the default one?

Re: Template troubles

PostPosted: Fri Sep 24, 2010 2:31 pm
by cantlep
:-( Just me then...

Custom template - fairly simple. in dataface/Dataface/templates. A file is called Exercise1Group.html
Code: Select all
<font face="calibri" size="2">
<table width="90%">

    <tr><th>Body Part:</th>
    <td>{$elements.Exercise1BodyPartName.html}</td>

    <th>Exercise:</th>
    <td>{$elements.Exercise1ExerciseName.html}</td></tr>

    <td>&nbsp;</td>

    <tr><th>Set Number:</th>
    <td>{$elements.Exercise1SetNumber1.html}</td>

    <th>Rep Number:</th>
    <td>{$elements.Exercise1RepNumber1.html}</td>

    <th>Weight (KG):</th>
    <td>{$elements.Exercise1Weight1.html}</td></tr>

    <tr><th>Set Number:</th>
    <td>{$elements.Exercise1SetNumber2.html}</td>

    <th>Rep Number:</th>
    <td>{$elements.Exercise1RepNumber2.html}</td>

    <th>Weight (KG):</th>
    <td>{$elements.Exercise1Weight2.html}</td></tr>

    <tr><th>Set Number:</th>
    <td>{$elements.Exercise1SetNumber3.html}</td>

    <th>Rep Number:</th>
    <td>{$elements.Exercise1RepNumber3.html}</td>

    <th>Weight (KG):</th>
    <td>{$elements.Exercise1Weight3.html}</td></tr>

    <tr><th>Set Number:</th>
    <td>{$elements.Exercise1SetNumber4.html}</td>

    <th>Rep Number:</th>
    <td>{$elements.Exercise1RepNumber4.html}</td>

    <th>Weight (KG):</th>
    <td>{$elements.Exercise1Weight4.html}</td></tr>

    <tr><th>Set Number:</th>
    <td>{$elements.Exercise1SetNumber5.html}</td>

    <th>Rep Number:</th>
    <td>{$elements.Exercise1RepNumber5.html}</td>

    <th>Weight (KG):</th>
    <td>{$elements.Exercise1Weight5.html}</td></tr>

</table>
</font>


fields.ini section is like this
Code: Select all

[fieldgroup:First_Exercise]
label = "First Exercise Section"
template="Exercise1Group.html"
section:order=0


Look OK? - Cheers

Re: Template troubles

PostPosted: Fri Sep 24, 2010 2:44 pm
by shannah
Is that the whole template, or did the forum strip out the header and footer?

Re: Template troubles

PostPosted: Fri Sep 24, 2010 3:43 pm
by cantlep
No, that's all of it..I guess I've missed something then?

I got the details from here - http://xataface.com/wiki/fieldgroup_template

Re: Template troubles

PostPosted: Fri Sep 24, 2010 4:20 pm
by shannah
Sorry... no you have it right... I didn't realize you were just doing a custom template for the fieldgroup.

In this case you don't need to add anything for css. I think the red boxes don't show up because you need to add them. Look at the default templates for forms and fieldgroups for hints on how to add the red boxes for required fields.

-Steve