0

ここに TypoScript コードがあります。

lib.membersList = CONTENT
lib.membersList{
table = tt_address
select{
    pidInList = {$membersStorageFolder}
    orderBy = zip, last_name
}

wrap = <div class="membersList">|</div>

renderObj = COA
renderObj{
    10 = FLUIDTEMPLATE
    10{
        file = fileadmin/templates/ext/memberslist/templates/membersList.html

        variables{

            portrait = IMAGE
            portrait{
                file.import = uploads/pics/
                file.import {
                    field = image
                    listNum = 0
                }
                file.height = 105
                file.width = 105c

                stdWrap.typolink{
                    parameter = {$membersPageId}
                    additionalParams.dataWrap = &ts_addresslist[showUid]={field:uid}
                    #returnLast = url
                    # The cache hash is needed to display the right content, since we are not running as USER_INT
                    useCacheHash = 1

                }
            }

            lastName = TEXT
            lastName.field = last_name
            lastName.typolink{
                 parameter.data = TSFE:id
                 additionalParams.dataWrap = &ts_addresslist[showUid]={field:uid}
                 # The cache hash is needed to display the right content, since we are not running as USER_INT
                 useCacheHash = 1

             }

            firstName = TEXT
            firstName.field = first_name
            firstName.typolink{
                 parameter.data = TSFE:id
                 additionalParams.dataWrap = &ts_addresslist[showUid]={field:uid}
                 # The cache hash is needed to display the right content, since we are not running as USER_INT
                 useCacheHash = 1

             }

            title = TEXT
            title.field = title

            organisation = TEXT
            organisation.field = company

            country = TEXT
            country.field = country

            city = TEXT
            city.field = city
        }
    }

}


stdWrap.override.cObject = CONTENT

stdWrap.override.cObject{
    table = tt_address
    select {
      andWhere.data = GP:ts_addresslist|showUid
      # Make sure there is no SQL injection!
      andWhere.intval = 1
      andWhere.wrap = uid=|
      orderBy = last_name ASC
      pidInList = {$membersStorageFolder}
    }

    wrap = <div class="membersDetail">|</div>

    renderObj = FLUIDTEMPLATE
    renderObj{

       file = fileadmin/templates/ext/memberslist/templates/membersDetail.html

       variables{

           portrait = IMAGE
           portrait{
               file.import = uploads/pics/
               file.import {
                   field = image
                   listNum = 0
               }
               file.height = 105
               file.width = 105c
           }

           lastName = TEXT
           lastName.field = last_name

           firstName = TEXT
           firstName.field = first_name

           title = TEXT
           title.field = title

           organisation = TEXT
           organisation.field = company

           country = TEXT
           country.field = country

           city = TEXT
           city.field = city

           detail = TEXT
           detail.field = description
       }
    }

    renderObj.stdWrap.append = TEXT
    renderObj.stdWrap.append{
        value = << Back to list
        typolink.parameter = {$membersPageId}
    }
}

stdWrap.override.if {
        isTrue.data = GP:ts_addresslist|showUid
        isTrue.intval = 1
}
}

すべてが正常に機能しています。リストが表示されます。最後の項目を除いた詳細ビューも。クリックすると、詳細ビ​​ューに空白のページが表示されます。クエリが何も取得しなかったかのように、情報はありません。

ここにテンプレートがありますが、非常に単純です。 membersList.html

<section>
{portrait -> f:format.raw()}
<div class="memberDetail">
    <h1>{lastName -> f:format.raw()} {firstName -> f:format.raw()}</h1>

    <h2>{title} - {organisation}</h2>

    <h3>{country} - {city}</h3>
</div>
</section>

membersDetail.html

<section>
{portrait -> f:format.raw()}
<div class="memberDetail">
    <h1>{lastName} {firstName}</h1>

    <h2>{title} - {organisation}</h2>

    <h3>{country} - {city}</h3>
</div>
<div class="bio">
    {detail}
</div>
</section>
4

1 に答える 1