简体   繁体   中英

Typo3 extbase - HMENU with multiple records

I have a products extension with a "Details" view. "Product" records are kept in a folder with ID 5. When I am on a product I want to have a menu with links to all the products from that folder. I this possible in Typoscript?

Thank you.

You can do everything using TypoScript :-).

lib.productList = CONTENT
lib.productList {
  table = tx_myext_domain_model_product
  select {
    # sorting criterion
    orderBy = tstamp DESC
    # PID list
    pidInList = 46,47
    # Maybe restrict the number of results
    max = 20
  }
  # Each result must be rendered like this
  renderObj = COA
  renderObj {
    1 = TEXT
    # Each field from your table can be used
    1.field = title
    1.wrap = <h1>|</h1>

    2 = TEXT
    2.field = description
    # If one field contains rich text, you can apply RTE parsing to it
    2.parseFunc < lib.parseFunc_RTE
  }

}

Now you can use the cObject ViewHelper to display your list in the Fluid template:

<f:cObject typoscriptObjectPath="lib.productList"></f:cObject>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM