Typolink里面的菜单COA

时间:2017-09-15 06:50:30

标签: typo3 typoscript typo3-7.6.x

我有一个自定义部分菜单,我需要链接菜单项的特定部分而不是整个部分。

目前,typolink部分没有做任何事情:

tt_content.menu.20.101 < tt_content.menu.20.3
tt_content.menu.20.101 {
  1.NO {
    doNotLinkIt = 1
    stdWrap.htmlSpecialChars = 0
    stdWrap.cObject = CONTENT
    stdWrap.cObject {
      table = tt_content
      select {
        pidInList.field = uid
      }
      renderObj = COA
      renderObj {    
        10 = TEXT
        10.field = header
        10.typolink {
          section.cObject = TEXT
          section.cObject.field = uid
          section.cObject.wrap = c|
        }
        20 = TEXT
        20.field = rowDescription
        20.wrap = <h6>|</h6>
      }
    }
  }
}

所以我想从上面的例子中得到的结果是:

<ul>
  <li><a href="/elementpage/#c1234">Element Header</a>Element Description etc..</li>
</ul>

1 个答案:

答案 0 :(得分:1)

documentation中你会发现两个可能性:

  1. 将完整的锚点(带哈希值)插入参数
  2. typolink { parameter.field = pid section.cObject = TEXT section.cObject.field = uid section.cObject.wrap = c| } 与参数的页面ID结合使用(假设锚点在另一页上)
  3. 给出了两个解决方案:

    self.viContainerLocation.hidden = YES;
    self.viContainerLocation.alpha=0.0;
    
    CGRect Conframe = self.viContainerLocation.frame;
    Conframe.size.height = self.view.bounds.size.height;
    self.viContainerLocation.frame = Conframe;
    
    self.tableView.translatesAutoresizingMaskIntoConstraints=NO;
    
    __block CGRect frame=self.tableView.frame;
    frame.size.height= self.view.frame.size.height-frame.origin.y;
    frame.size.width=self.view.frame.size.width;
    self.tableView.frame=frame;
    

     [UIView transitionWithView:self.viContainerLocation
     duration:0.0
     options:UIViewAnimationOptionTransitionCrossDissolve
     animations:^{ }
     completion:^(BOOL finish){ 
     __block CGRect frame=self.tableView.frame;
     frame.size.height= self.view.frame.size.height-frame.origin.y;
     frame.size.width=self.view.frame.size.width;
     self.tableView.frame=frame; 
     }];