Template troubles

A place for users and developers of the Xataface to discuss and receive support.

Template troubles

Postby cantlep » Wed Sep 15, 2010 1:04 am

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
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Template troubles

Postby shannah » Fri Sep 17, 2010 11:23 am

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Template troubles

Postby cantlep » Sat Sep 18, 2010 11:48 am

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
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Template troubles

Postby shannah » Sun Sep 19, 2010 11:33 am

It's hard to say from this vantage point. There's a problem somewhere but it would require hands o investigation.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Template troubles

Postby cantlep » Tue Sep 21, 2010 2:35 pm

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?
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Template troubles

Postby shannah » Tue Sep 21, 2010 2:46 pm

You can either use a block (e.g. custom_stylesheets), or you can add a <link> tag directly in your templates.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Template troubles

Postby cantlep » Fri Sep 24, 2010 1:55 pm

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
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Template troubles

Postby shannah » Fri Sep 24, 2010 2:28 pm

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?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Template troubles

Postby cantlep » Fri Sep 24, 2010 2:31 pm

:-( 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
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Template troubles

Postby shannah » Fri Sep 24, 2010 2:44 pm

Is that the whole template, or did the forum strip out the header and footer?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Template troubles

Postby cantlep » Fri Sep 24, 2010 3:43 pm

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
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Template troubles

Postby shannah » Fri Sep 24, 2010 4:20 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 25 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved