A
A
Avivar2015-03-20 13:03:30
Drupal
Avivar, 2015-03-20 13:03:30

How to make a Drupal 7 user menu?

Hello.
I decided to learn Drupal, and started by creating a template.
And for several hours now I have been looking for information about the layout of the User menu block .
Initially, I made a region, I placed the blocks User menu and Login to the site in it .
For the "Login to the site" block, I created the file block--user--login.tpl.php and added to it

<form accept-charset="UTF-8" method="post" action="/node?destination=node">
                        <div class="login">
                            <span>Логин:</span>
                            <input type="text" name="name">
                        </div>
                        <div class="password">
                            <span>Пароль:</span>
                            <input type="password" name="pass">
                            <input type="hidden" value="" name="form_build_id">
                            <input type="hidden" value="user_login_block" name="form_id">
                        </div>
                        <div class="abutton">
                            <input type="submit" value="Вход" name="op">
                            <div class="aurl">
                                <a href="/user/register">Регистрация</a><br />
                                <a href="/user/password">Забыли пароль?</a>
                            </div>
                        </div>
                    </form>

I wanted to make the same model for the "User menu", but I did not find any information on creating a file for this block.
I am doing this now
<?php if(!$logged_in): ?>
  //код выше
<?php else: ?>
  <a href="/user/logout">Выйти</a>
<?php endif; ?>

How to lay out these blocks?
And where can I see the information, what data can be displayed in a particular block (for example, a user's avatar, nickname, etc.)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2017-11-18
@ikode

It's easier to use the jQuery Superfish menu module and code it already.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question