Lempkin
Lempkin

Reputation: 1578

Template on Web content structure

I've made a web content structure which contain a field "Query_Title". The field Query contains sub fields : "Description" and "url".

I had to create a template for this new structure which is :

#if (!$Query_Title.getSiblings().isEmpty())
   #foreach ($cur_Query_Title in $Query_Title.getSiblings())
      $cur_Query_Title.getData()
  #end
#end

I would like to display every field : Title (as i already do) and Description and url as well, but i have no idea how to access them... Any idea?

Upvotes: 0

Views: 97

Answers (1)

Tobias Liefke
Tobias Liefke

Reputation: 9022

$cur_Query_Title is of type TemplateNode, which is (beside some other functionality) a map that contains the sub fields: $cur_Query_Title.Description.data and $cur_Query_Title.url.data should work for your example.

Upvotes: 1

Related Questions