进度太滑水今天被boss批评了(望天
本来以为很好实现的功能结果到处找不到哪里可以加连接,简单搜索一下这个功能竟然还有要用插件,试了两个插件以后最后还是找到免插件的解决方案(其实也是写不来token)。
原文:
BY jeni_dc commented 5 years ago I'd just create a view to display that image on my node type. Add another field to store the link in your node, then create a view with two fields, your link and your image. Arrange the fields in your view so the link is first, then the image. Exclude the link field from display. When setting up your image field in the view you'll need to rewrite the results. Select "output this field as a link", and in the link path enter the token for your link field, that will be in the replacement patterns below. Then to make sure your view is only showing the image and link associated with the particular node you are viewing, you'll need to add a contextual filter. Just add a filter for "Content: Nid" and select "Hide view" for when the filter is not available. Then in your panel for your node display, remove the field that was displaying your image and add the view in it's place.
思路:
- 给每张幻灯片(自定义content types)增加url的field
- 在用view做幻灯片的时候,先add url这个field,并设为excluded from display,这样就不会显示url
- 然后再add image field,注意先后不能错, 在image的setting -> rewrite the result -> output this field as a link,添加replacement pattern, 可以在下面的备选里看到url field(没看到的话就出错了)。
- 完成!