2017-07-29 75 views
0

我想在我的博客中添加子菜單。我想我的菜單是這樣(手動測試和自動化測試成爲測試的子菜單)在Blogger中添加子菜單(pageListJSON)

  • 測試
    • 手動測試
    • 自動化測試

有在互聯網上有很多教程。但是,他們仍然使用舊版博客設計,他們使用<ul><li>語法。在新的博客(我不知道什麼時候開始)中,博主使用JSON進行頁面列表管理,而不是使用<ul><li>

追隨中是從我的博客中pageListJson

<b:widget id='PageList1' locked='false' title='Pages' type='PageList'> 
<b:widget-settings> 
    <b:widget-setting name='pageListJson'> 
    <![CDATA[{'91385535799150449': {'href': 'https://belajarbersama-arwan.blogspot.com/p/belajar-software-testing.html', 
      'title': 'Software Testing', 
      'position': 0}, 
    '4514379653067780013': {'href': 'https://belajarbersama-arwan.blogspot.com/p/manual-testing.html', 
      'title': 'Manual Testing', 
      'position': 1}, 
    '5318229156935072720': {'href': 'https://belajarbersama-arwan.blogspot.com/p/automated-testing.html', 
      'title': 'Automated Testing', 
      'position': 2}}]]> 
    </b:widget-setting> 
    <b:widget-setting name='homeTitle'>Home</b:widget-setting> 
</b:widget-settings> 

使用該JSON,菜單似乎是這樣的:

  • 測試
  • 手動測試
  • 自動化測試

我試圖修改JSON是這樣

{'91385535799150449': 
    {'href': 'https://belajarbersama-arwan.blogspot.com/p/belajar-software-testing.html', 
    'title': 'Software Testing', 
    'position': 0, 
    '4514379653067780013': {'href': 'https://belajarbersama-arwan.blogspot.com/p/manual-testing.html', 
      'title': 'Manual Testing', 
      'position': 1}, 
    '5318229156935072720': {'href': 'https://belajarbersama-arwan.blogspot.com/p/automated-testing.html', 
      'title': 'Automated Testing', 
      'position': 2}}} 

但是,只有一個菜單出現,即軟件測試

任何人可以幫助我如何可以修改JSON,所以我可以得到我想要的菜單結構?

感謝你們的盛情幫助

回答

1

分頁控件沒有子菜單,JSON腳本只是設置的目的只有像標題,URL和位置,而不是增加一些。 如果您想爲每個列表創建子菜單,您可以使用ul和li手動添加。

+0

感謝您的幫助Mainstreem。如果是這種情況,那麼我會用'ul'和'''手動添加它。 –