Contents Menu Expand Light mode Dark mode Auto light/dark mode
Richy 1.0.0-beta documentation
Richy 1.0.0-beta documentation
  • Basics
  • Cache
  • Dev
  • Frontend
  • Settings
  • Tasks
  • Templates
    • Menu
    • Template tags
    • Incudables
  • Assets
  • Charts
  • Fixtures
  • Form fields
  • Math
  • Item
  • Scraper
  • Charts
  • Tasks
  • Tasks
  • Coin IDS
  • Tasks
  • Charts
  • Dividends
  • Performance
  • Tasks
  • Transactions
  • News
  • Tasks
  • Components
    • ItemChart
    • ItemPrice
    • News
    • The Eye
  • Styles
  • Basics
  • Server
  • CI
Back to top

Menu#

Menu is separated into 2 parts - main menu and submenu.

Main menu is created via django-sitetree library and is managed in Django admin.

Submenu contains following parts (order preserved):

  1. pages on the same level as parent of the current page

  2. child pages

  3. dynamic items

Dynamic submenu is managed programaticaly. If a view needs it’s custom submenu you can create one quite simple thru predefined view mixin richy.core.views.SubmenuViewMixin. This mixin adds method get_sumenu() that you need to implement by yourself. The method must return list of menu items where each items is a dict with following properties:

  • url - menu item URL

  • title - menu item title

  • is_current - flag if the menu item is currently active page

Here is simple example that News section uses:

Output then looks like this:

../../_images/submenu.png
Next
Template tags
Previous
Templates
Copyright © 2024, n1
Made with Sphinx and @pradyunsg's Furo