Question

We are working on a tutorial Website project. Currently, we have gathered Wonderful template made with front-end framework Bootstrap.

Because of robust performance, we have decided to move to Drupal, yet the Drupal experience level is narrow, so someone having experience can reply.

Project Structure: This is a tutorial website. For some post, upon selecting, there is option to select sidebar(html links)

Sample Sidebar

<ul class="nav flex-column pl-0">

<li class="nav-head">Xamarin</li>

<li class="nav-item"><a class="nav-link" href="#">Overview</a></li>
<li class="nav-item"><a class="nav-link active" href="#">Analytics</a></li>
<li class="nav-item"><a class="nav-link" href="#">Export</a></li>
<li class="nav-item"><a class="nav-link" href="#">Snippets</a></li>
<li class="nav-item"><a class="nav-link" href="#">Flexbox</a></li>

<li class="nav-header">Xamarin Installation</li>

<li class="nav-item"><a class="nav-link" href="#">Layouts</a></li>
<li class="nav-item"><a class="nav-link" href="#">Templates</a></li>
<li class="nav-item"><a class="nav-link" href="#">Themes</a></li>

</ul>

How to store the above markup, which serves the purpose of sidebar - it could act as block(or something embedded - PHP code, with Drupal Native Caching support).

Upon a new node(content/post) opened, it should be fetched with minimal query, there could be hundreds requests to serve, we do not want to clutter more database queries, just fetch from available column -

Any ideas/solutions are welcome. If you do not understand the above project - Comment

How to store this: we are from wordpress, so understanding Drupal is enter image description here

Était-ce utile?

La solution

I have found the best way to handle a request like this is to utilize the block system as normal. On your content types that you want custom sidebars for, add a new "sidebar" field. I normally make that a Paragraphs field. Then create a block that you have placed in the actual sidebar via the blocks system that renders the content from that sidebar field if it exists.

This lets you have both globally controlled blocks and custom sidebars per content.

Licencié sous: CC-BY-SA avec attribution
Non affilié à drupal.stackexchange
scroll top