Topic: Plug - custom menu

English:
I'm so sorry, my English is poor - I use an interpreter. sad

I need to write a plugin that would contain the second menu (main). This blog is only part of the whole project. To blog also included in the HTML page and forum.

The plug has a display in a designated place my menu (similar principle as the default menu).
I want to be able to edit links (internal and external) in the panel.

How can I do it. I do not know object-oriented PHP. sad



Polish:
Bardzo przepraszam, mój angielski jest kiepski - korzystam z tłumacza. sad

Potrzebuję napisać wtyczkę, która zawierałaby drugie menu (główne). Blog jest tylko częścią całego projektu. Do bloga wlicza się również strona HTML i forum.

Wtyczka ma wyswietlać w wyznaczonym przeze mnie miejscu menu (podobna zasada jak w domyślny menu).
Chcę, aby była możliwość edycji linków (węwnętrznych i zewnętrznych) w panelu.

W jaki sposób moge to zrobić. Nie znam obiektowego PHP. sad

Re: Plug - custom menu

Are you able to just copy the same code that is in your other site and put it in the template?

If that's beyond what you can do, you may need to look to a web developer to help with your specific needs.

Re: Plug - custom menu

EN:
I made a page in HTML and skim through it to the script.
I create a new template based on the default.

PL:
Zrobiłem stronę w HTML i przerzucam ją do skryptu.
Tworzę nowy szablon na bazie domyślnego.

Re: Plug - custom menu

Hi,

I add this code but it's not perfect because, sometimes the links are not good... So, this is a first attempt:

Here is the code in CSS file (themes/yourtheme/css/main.css)

/* ============================== */
/* NAVIGATION */
/* ============================== */

nav {
  width: 100%;
  height: 60px; 
  position: fixed; 
  top: 0;
  background: #D52D4E;
}

nav ul {
  padding: 20px;
  margin: 0 auto;
  list-style: none;
  text-align: center;
}
nav ul li {
  display: inline-block;
  margin: 0 10px;
}
nav ul li a {
  padding: 10px 0;
  color: #fff;
  font-size: 1rem;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s ease;
}
nav ul li a:hover {
  color: #7E1B2F;
}
a.active {
  border-bottom: 2px solid #ecf0f1;
}

/* Headings */

h1 {
  font-size: 5rem;
  color: #34495E;
}

The code in the php file (themes/yourtheme/templates/default.bit)

Paste it after <body>

<nav>
  <ul>
    <li><a href="../index.php">Home</a></li>
    <li><a href="../blog/">Blog</a></li>
    <li><a href="../forum/">Forums</a></li>
  </ul>
</nav>

That's it.

BUT, it works only on the main page (index). If you are on a post page, the following link change like this:
- nav link on the main page: mywebsite.com/index.html
BECAME
- nav link on a post page: mywebsite.com/blog/post/index.html
There is /blog/post/ in the link so, it doesn't work...

If someone, real coder, can help us smile Thank you

dijiko.com | magicfred.com

Re: Plug - custom menu

Unfortunately not what I meant.

I did it that way. I do not know whether it is a good idea.

<footer>
        <?php
            if(!empty($plugins))
            {                
                $plugin_id = 1;
                foreach($plugins_sidebar as $plugin){
                    if($plugins_sidebar[$plugin_id]->slug_name == "plugin_categories" OR
                        $plugins_sidebar[$plugin_id]->slug_name == "plugin_pages"){
                        echo '<div class="col quarter">';
                        echo '<h3>'.$plugins_sidebar[$plugin_id]->database('title').'</h3>';
                        echo '<p>'.$plugins_sidebar[$plugin_id]->blog_body().'</p>';
                        echo '</div>';
                    }
                    $plugin_id++;
                }
                /*
                echo '<div class="col quarter">';
                echo '<h3>'.$plugins_sidebar[2]->database('title').'</h3>';
                echo '<p>'.$plugins_sidebar[2]->blog_body().'</p>';
                echo '</div>';
                */
            }
        ?>

        <div class="col quarter">
            <h3><?php echo $_LANG['VIEW_BLOG']; ?></h3>
            <ul>
              <li><a class="top" href="#">Top</a></li>
              <li><a href="<?php echo $layout['feed'] ?>">Atom</a></li>
            </ul>
        </div>
          
        <!--
        <div class="col quarter">
            <h3>Znajdź nas</h3>
            <ul>
              <li><a href="#">Facebook</a></li>
              <li><a href="#">Twitter</a></li>
              <li><a href="#">Tumblr</a></li>
            </ul>
        </div>
        -->
        <script>
        $(".top").click(function(){
            $("html, body").animate({ scrollTop: 0 }, 600);
            return false;
        });
        </script>
    </footer>