开发者

Question about an array in gallery2

I'm working on a modification from a theme in the open source project "gallery2".

Here is the code that I am looking at:

For anyone familiar with it, its in the SearchShowAll.tpl file开发者_如何学JAVA in the search module in the modules section of the download.

    <ul class="giInfo">
      {foreach from=$result.fields item=field }
              <li>
                <span class="ResultKey">{$field.key}:</span>
                <span class="ResultData">{$field.value|default:"&nbsp;"|markup}</span>
              </li>
      {/foreach}
    </ul>

It is a smarty foreach loop and it grabs this data

Title: BB 08 PR 6-340

Summary:

Keywords: A Hillbilly Cat; Gavin Jordan; Margo Hazell

Description:

Owner: Gallery Administrator

However, I just want it to get the Title: and display it, not any of the other stuff. I am unsure of what the array looks like and how to get a specific value from it in smarty format and also in the case of this gallery.


I used section tags to figure this out. I was referencing the array value wrong as well. Here is how I got it to work.

{section name=field loop=$result.fields max=1}
              <li>
                <span class="ResultData">{$result.fields[field].value|default:"&nbsp;"|markup}</span>
              </li>

{/section}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜