How to show DD block data on a page?

Shiv's Avatar

Shiv

12 Jun, 2012 04:03 PM

In my scenario, I've set up data definition blocks to contain staff member information (name, job title, contact, short bio, etc.), one block per staff member. These blocks are used to generate a Staff index page, which lists all the staff members on one page. No problem there.

Now, I'd like to be able to specify a contact person for any other page on the site. It's a simple matter to add a block chooser in the data definition for the page, so that when adding/editing the page, I can select one of the staff member blocks.

However, I'm stumped about how to get the staff member's details onto the page. The calling-page XML shows something like this:

`

<calling-page>
    <system-page current="true" id="dbfd110480ce0cf200260657baa183ad">
        [...]
        <system-data-structure>
            <page-content>
                [...]
            </page-content>
            <contact>
                <content/>
                <path>/blah-blah/www/staff/joe-shlabotnik</path>
                <name>joe-shlabotnik</name>
            </contact>
        </system-data-structure>
    </system-page>
</calling-page>

`

...so, for the data definition block, the XML shows ONLY the path and system name. How do I get it to show all the other fields (name, job title, contact, short bio, etc.), so I can use these data on the page?

  1. Support Staff 2 Posted by Charlie Holder on 12 Jun, 2012 04:30 PM

    Charlie Holder's Avatar

    In the actual DD where you defined to use the Block Chooser, make sure that field has "Render Content Depth" set to 2. You will find it as an advanced field on the chooser options. Hope this helps!

  2. 3 Posted by chaoaj on 12 Jun, 2012 04:47 PM

    chaoaj's Avatar

    Shiv,
    I think you need to look at doing what we term a configuration block.
    This block would be a block tied to the page via a block chooser in the DD
    for the calling page. The configuration block would choose the block for
    the staff member who is the contact for that page. Set your max render
    depth attribute on that block chooser accordingly(probably at least 5)
    then you can get to the level of the individual name job title etc.

    Regards,
    @lvin
    ------------------------
    Alvin Chao ­ IT Web
    JMU - MSC 5734 - Massanutten Hall 293
    Harrisonburg, VA 22807
    540-568-6206
    [email blocked]
    http://educ.jmu.edu/~chaoaj

  3. 4 Posted by Shiv on 12 Jun, 2012 04:49 PM

    Shiv's Avatar

    Worked! Thanks, I'll try to remember this.

  4. 5 Posted by Shiv on 12 Jun, 2012 04:50 PM

    Shiv's Avatar

    Both answers are correct. I only need a render depth of 2, since my staff-member data definition doesn't include any groups or complex data.

  5. Support Staff 6 Posted by Ryan Griffith on 18 Jun, 2012 08:00 PM

    Ryan Griffith's Avatar

    Hi Shiv, just following up because it looks like you discussion has been answered. I am going to close this discussion, feel free to re-open this discussion by replying.

    Thanks.

  6. Ryan Griffith closed this discussion on 18 Jun, 2012 08:00 PM.

Comments are currently closed for this discussion. You can start a new one.