Can we have different menu items for cards formed using htmlPages attribute of the timeline?

偶尔善良 提交于 2019-12-10 14:45:56

问题


I'm creating a bundle using timeline.html as my cover page and providing other sub-pages using the timeline.htmlPages attribute. I want to have different menu items for the cover page as well as for each of the sub-pages. Currently I dont' see any way to have a menuItem for each htmlPage and/or the cover page. Am I missing something ?

I have a work around for this which I did during Glass Foundry : I created a random bundle id, then i looped over all my html pages and using the same bundle id inserted a timeline item, with the same cover page and a single htmlPages with whatever menuItems i want for that index. This works as I want, however since this results in N insert() calls, it takes a lot of time for the glass to receive the bundle [also eats into my api quota as a side effect]


回答1:


You can only have one menu for a given timeline card, even if it has many pages.

timelineItem.html and timelineItem.htmlPages are intended to be used for a single logical piece of content that just happens to exceed the space available on the screen. For this reason, they all share the same menu and the same timelineItem.id.

If you require a different menu for each page, you probably have content that's logically separate. This warrants a distinct timeline card for each piece of content, and this allows you to specify a different menu. Bundling by timelineItem.bundleId allows you to group similar distinct cards, just as you describe.

The total amount of data transmitted is roughly the same, so total latency shouldn't be too much of an issue. If the gradual insert is noticeable, consider only setting timelineItem.notification on the last item to be inserted.



来源:https://stackoverflow.com/questions/16353179/can-we-have-different-menu-items-for-cards-formed-using-htmlpages-attribute-of-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!