0

所以我正在使用 ez Publish。我有一个包含 3 个儿童班的联系人文件夹。

我在头部定义:

{    $contact_node_id = 258
$contact_classes = array('dnd_locations','dnd_textblock','dnd_contactform')
$contact_folder = fetch( 'content', 'node', hash( 'node_id', $contact_node_id ) )
$contact_children = array()
$contact_children_count=fetch_alias( 'children_count', hash( 'parent_node_id', 258,
                                        'class_filter_type', 'include',
                                        'class_filter_array', $contact_classes ) )
}

{if $contact_children_count}
    {set
    $contact_children = fetch_alias( 'children', hash( 'parent_node_id', $contact_node_id,
                                        'offset', 0,
                                        'sort_by', array( 'priority', true() ),
                                        'class_filter_type', 'include',
                                        'class_filter_array', $contact_classes,
                                        'limit', 100 ) )
    }
{/if}

要获取我使用的内容:

    {if $contact_children_count}
    {foreach $contact_children as $index => $child }
        {node_view_gui content_node=$child view=full}
    {/foreach}
{/if}

但随后它会获取所有 3 个孩子的内容。我如何定义它应该只获取第一个?

希望有人能帮助我。

4

1 回答 1

3

获取功能中的“限制”是您正在寻找的。

所以用 1 代替 100。就是这样

于 2015-03-07T04:09:31.490 回答