A
A
Alexey2020-05-21 15:12:38
Twig
Alexey, 2020-05-21 15:12:38

How to scatter subcategories into different blocks on the main one?

Good to everyone!

I can't figure out how to check the category by id in the template file and display its descendants in a specific block in tabs.
Tell me who can please.

<section class="wrap_block">
      <div class="wrap_content-main catalog">
          <div class="zagolovok_katalog">Каталог</div>
          <div class="perekluchatel_katalog">
              <div id="pilomat" class="btn_catalog active">Категория 1</div>
              <div id="metal" class="btn_catalog">Категория 2</div>
          </div>
          <div id="tab_pilomat" class="tab_catalog active">
              {% for category in categories %}
                {% if category.category_id == category_id %} 
                {% if category.children %}
                  {% for child in category.children %}
                    {% if child.category_id == child_id %}
                      <a href="{{ child.href }}" class="list-group-item active">&nbsp;&nbsp;&nbsp;- {{ child.name }}</a> 
                      {% else %}  
                      <a href="{{ child.href }}" class="list-group-item">&nbsp;&nbsp;&nbsp;- {{ child.name }}</a>
                      {% endif %}
                  {% endfor %}
                {% endif %}
                  {% else %} <a href="{{ category.href }}" class="list-group-item">{{ category.name }}</a>
                {% endif %}
              {% endfor %}
          </div>
          <div id="tab_metal" class="tab_catalog">
              {% for category in categories %}
              {% if category.category_id == category_id %} 
              <a href="{{ category.href }}" class="list-group-item active">{{ category.name }}</a> 
              {% if category.children %}
              {% for child in category.children %}
              {% if child.category_id == child_id %}
              <a href="{{ child.href }}" class="list-group-item active">&nbsp;&nbsp;&nbsp;- {{ child.name }}</a> 
              {% else %} 
              <a href="{{ child.href }}" class="list-group-item">&nbsp;&nbsp;&nbsp;- {{ child.name }}</a>
              {% endif %}
              {% endfor %}
              {% endif %}
              {% else %} <a href="{{ category.href }}" class="list-group-item">{{ category.name }}</a>
              {% endif %}
              {% endfor %}
          </div>
      </div>
  </section>

Answer the question

In order to leave comments, you need to log in

12 answer(s)
A
Alexander Alexandrovich, 2014-03-08
@Quaro

Debian Gnome
ubuntu 12.04
elementary os
Stable and more beginner friendly

I
Igor Andryushchenko, 2014-03-09
@Tvistar

Mint is currently one of the best solutions for you. It will be convenient for you to program on almost any distribution kit. Installing the necessary programs leans towards a few lines in the terminal.
The drivers are still very good 99.9 percent of the time, with the exception of very unique sound cards.
I have a lot of experience using various systems and so far I have settled on Mint. As for the easiest to use and initial setup (for my needs, the system is ready 20 minutes after installation)
I will try to describe my impressions.
- The most Windows-like interface. Switching to it will not bring much discomfort.
-For correct operation, it was necessary to set up the video by downloading the driver from the Radeon off site.
-High speed after installing the driver.
-Very high speed and beautiful interface
-There are some shortcomings in user interaction with the system.
-It imposes restrictions where it seemed it should not be. So I could not start the installation of the deb package. Whatever I did, wrote - there is no access.
-After the official update did not start. Stuck on the OS boot logo :D
- A peculiar interface that takes a couple of days to get used to.
-Slightly limited set of applications that can be installed out of the box (solved by installing Synaptic)
-Did not work through the graph. interface to set up a wired internet connection.
-Hardcore installation and setup. A beginner without a 2nd device and an open installation manual is unlikely to figure out how to properly configure the system.
-A huge selection of possible applications to install, out of the box.
- A system for those who like to fine-tune their work environment to their Wishlist and can spend a week or two on it.
The conclusion is this. Any distribution kit from 10 popular will suit you. Any of them, with the right settings, can be made to work as the owner needs. With drivers, also none of them has problems. Each has a large number of fans and almost all possible problems have been sorted out on the official forum.
The only question is, what do you want? Right out of the box, have a beautiful and friendly interface (Mint, Elementary OS) or customize all the work of applications, interface, display information for yourself (ArchLinux).

R
Ruslan Tovmasyan, 2014-03-11
@sanslar

Tried different distributions: ArchLinux, Ubuntu (all releases from 12.04 to 14.04), Linux Mint, Debian (stable, testing, sid), Elementary OS.... It seems to be everything.
The most important thing is to choose which packages you need: stable, fresh stable, freshest!
Debian provides for example such branches as stable, testing, sid. In the Testing branch there are fresh packages that are stable, in the Stable branch they are super stable (for servers, that's it), in Sid the packages are fresh as in the Arch Linux distribution, only Debian is easier to install! :) That's the point.
Everything is simpler in Ubuntu, 12.04 is now for servers, 13.10 is stable for home computers, but it will work for servers (Ubuntu Server), 14.04 is a test version, not stable. (I'm on it now)
And of course, the main thing to choose a development environment, I would suggest to you:
MATE is lightweight, convenient, easy to make beautiful.
LXDE, XFCE - the same benefits.
Unity is beautiful from the start, does not require customization, everything you need is out of the box, it is great like other DE for development.
Pantheon - DE, like Mac OS X, beautiful, super fast, works great on old computers, thanks to the smooth hands of developers :)
KDE - super flexible in customization, allows you to customize yourself from and to, make rooms (working modes: development, rest), widgets... In general, such a universal DE, not particularly heavy, in the latest versions it is very well optimized.
Tiled WMs: Awesome, Dwm, i3- a sort of choice, for advanced users and developers, the setup goes through writing configs, and compiling, in Awesome, for example, you need to know Lua to make WM as you need.
Also, from the pluses, I would note the tiling, it is very convenient in development, since the mouse is not needed at all.
Now you need to choose the distribution itself, I'll just note what I personally liked about each of them.
Arch Linux- I liked the pacman package manager, super convenient, and fast. The AUR also makes things easier - these are repositories with packages that are not included in the official repositories. I also liked the speed of work, flexible manual configuration of the system from scratch, like Gentoo only, no need to compile. And of course I liked the freshness of the packages, every day updates are 20-100mb each (for some this is a minus), another minus is that you must not forget to update at least once a week, otherwise you will have to crutch so as not to break the system after the update.
Debian- the largest number of packages is in the Debian repositories! This is the main plus of this distribution and their community! I also like the fact that you can choose which system you want, stable or build it yourself "almost" from scratch (like Arch Linux only installation via the GUI interface (there is a console version of the installation, in the end you just assemble the system piece by piece like Arch Linux, only the configuration files are already configured as needed)).
ubuntu- install and use. It is also divided into Kubuntu, Lubuntu, Xubuntu, etc. Ubuntu Based distributions, that is, when choosing distributions, you immediately choose the environment with which it will go, just like in Debian. But the default is Unity. The only advantage is that everything is out of the box and everything is easy to install, easy system update via GUI interface, etc. I also like the division into different branches. As in Debian, in principle, there are security updates somewhere (12.04), somewhere there is a stable system update with fresh stable packages (13.10), and you can also help test the next version of Ubuntu 14.04 LTS, which will have a long support time from Canonical. (From myself: I didn’t find any critical bugs for a week, or rather there was one, but they fixed it instantly :)).
Linux Mint- Ubuntu based distribution, everything is the same only DE is different, Cinnamon, MATE - (you can easily put it on Debian, Arch Linux).
Elementary OS - I spent a lot of time on this distribution, as well as on Arch Linux and Debian, the only difference is that I constantly changed DE, WM in them ... And then I installed and sat for a long time, and I liked it, and now I would I set it if the installer was friends with UEFI (a kind of BIOS), but alas, it’s not friendly, and there’s no point in poking around and sticking to UEFI, and I don’t want to work through the Legacy mode on a crutch. So the distribution is beautiful to the point of madness, it’s difficult, but you can put them in DE on Arch Linux! I like the fact that it is also stable, but the stability is all due to the fact that it is based on Ubuntu 12.04, I'm waiting on the basis of 14.04! :)
As I said, choose which system you need, stable, fresh or super convenient. And choose the environment to taste and color, and everyone is suitable for work! :)

A
Alexander, 2014-03-08
@ROR191505

If the reading skill is pumped, then I recommend ArchLinux. Huge amount of documentation, but a bit difficult for a beginner (manual installation, for example). Everything is described in great detail and intelligibly. Uses always the latest packages. You can choose absolutely any interface (very fine-tuning of the system is available).

M
macos, 2014-03-08
@macos

Choose Mint, you won't go wrong. How many years I have been sorting out distros, there are very few complaints about the mint. The case when you set it and forgot, and you don’t smoke mana, as if to finish something.

E
Evgeny Komarov, 2014-03-10
@maNULL

In due time long sorted out distribution kits. Went through Fedora, Ubuntu, Mint, Debian, ArchLinux. As a result, I settled on OpenSUSE. Everything works out of the box. With updates, the system does not crash, it works very fast (on my ancient 2-core AMD with 4 gigs of memory). Interface ... well, there are no complaints at all. I'm on sneakers, and I haven't seen a more nimble and optimized DE out of the box in any distro.

S
Shackled, 2014-03-08
@Shackled

Debian x86 with PAE kernel

U
usershelpme, 2014-03-08
@usershelpme

Debian wheezy. As a WM use awesome (at worst dwm), it will fly.

A
Anatly Petrov, 2014-03-09
@FisHlaBsoMAN

if you like to read - gentoo. minimum glitches, minimum problems with x64 software. Installation is long, but quite simple for handbook. If you don't want to suffer, take elementary.

A
Alexsandr Pegushin, 2014-03-09
@jijidesign

I am currently using Debian + Fluxbox. Since I bought a new laptop and urgently needed for use at work.
And so for Slackware, Gentoo, Archlinux.
Ubuntu 13.04 - I put it on my laptop, I got tired of constant errors about program crashes.
Elementary OS - some applications did not work, did not start and there was no wallpaper, instead of it there was a black screen.
Pleased Slak, everything got out of the box right away.

M
motandi, 2014-03-14
@motandi

debian

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question