Hiding sections in 1.0

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

Hiding sections in 1.0

Postby gorzek » Fri Jul 18, 2008 6:10 pm

I looked through the documentation for custom sections, though a lot of it appears incomplete.

I have reimplemented the related records section on one of my views. Is there a way for me to just remove the old one? Basically, I put the new one in the main column, rather than on the left. Even giving them the same section name (e.g. submissions__relationship), they both show up--one does not replace the other. I just want the one on the left to go away.

Is there a way to do this easily without modifying templates?
gorzek
 
Posts: 27
Joined: Thu Jun 19, 2008 9:57 am

Postby shannah » Mon Jul 21, 2008 6:53 pm

I apologize for the scanty documentation... many of the bleeding edge features of xataface still require documentation.

To hide the default relationship section, you can add the following to the relationships.ini definition of the relationship:

section:visible=0

Note that the following directives are also available:
section:permission
section:label
section:order
section:limit
section:filter
section:sort
section:class (accepts 'left' or 'main')

E.g. relationships.ini
Code: Select all
[my_relationship]
    __sql__ = "select * from etc ..."
    section:permission="edit" ;; only show this section if the user has edit permissions
    section:label="My Relationship label"
    section:order="2" ; The order in which the section should be located.
    section:limit="10";  Show 10 records
    section:filter="postDate>'2004-3-2' and ownerID=10" ; Show only records in this relationship newer than '2004-3-2' and owned by ownerID 10.
    section:sort="postDate desc, firstName asc" ; Sort records
    section:class="main" ; This section should be in the main column.



Hope this helps a little.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby gorzek » Mon Jul 21, 2008 6:59 pm

Awesome! That's what I was looking for. I get the feeling Xataface has a lot of cool features that are unfortunately not documented yet. I think I've found one or two while implementing my project on 1.0b3. :)

Thanks again!
gorzek
 
Posts: 27
Joined: Thu Jun 19, 2008 9:57 am

Postby gorzek » Mon Jul 21, 2008 7:19 pm

One other thing... say I want to hide a section that's not in a relationship, such as the Details section in the Browse action. I tried putting it in fields.ini, but it didn't do anything. How do you hide a non-relationship section?

Sorry I have so many questions.
gorzek
 
Posts: 27
Joined: Thu Jun 19, 2008 9:57 am

Postby shannah » Mon Jul 21, 2008 7:48 pm

The default section (edit details) is implicitly named '__main__'. So you can add attributes to this section in the fields.ini file just as you would any other section:

Code: Select all
[section:__main__]
    label="My custom label"
etc...
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby gorzek » Mon Jul 21, 2008 8:26 pm

Aha! That was not very obvious. So, I can control any section (besides relationships) in fields.ini via [section:%name%] blocks?
gorzek
 
Posts: 27
Joined: Thu Jun 19, 2008 9:57 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 26 guests

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