Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How do i implement html with php in the default.master.php?

Hi! I'm a newbie with this script (and with php XD ) sorry if this post doesn't go in this section :/
here is my question, I have this html code: (the css was no problem :) )

<ul id="lava-menu"> <li><a href="#">Menu 1</a></li> <li><a href="#">Menu 2</a></li> <li><a href="#">Menu 3</a></li> <li><a href="#">Menu 4</a></li> <li><a href="#">Menu 5</a></li> <li><a href="#">Menu 6</a></li> <div class="cont-l"> <div id="lavalamp"></div> </div> </ul>

and i want to use it in my default.master.php, I've never used php before so i don't know how to mix it :'(
If anyone can help me, I would be more than happy to do anything i can for him/her.

PS: My forum isn't online, im working on "localhost" because I don't have internet acces at home, I'm currently at school XD

Tagged:

Answers

  • edited February 2013

    @KiritoBS
    Where are you planning to add this or expect it to appear?
    This would put the links in the menu :

    
     <?php
                      $Session = Gdn::Session();
                        if ($this->Menu) {
    $this->Menu->AddLink('Home', T('Home'), '/');
    $this->Menu->AddLink('Home', T('Activity'), '/activity');
    $this->Menu->AddLink('Home', T('Categories'), 'categories/all');
    $this->Menu->AddLink('Home', T('Discussions'), '/discussions');
    $this->Menu->AddLink('Home', T('Mobile View'), 'profile/mobile');
    }?>
    

    You can also add it like html just make sure it is in the right place so it does not mess up the other sections. My theme Heavy Metal has something like that, you could download it and study how it is put together then replicate it.

    By putting Home in the beginning of the links I am creating a submenu under Home, the links below home are < li > if you want them standalone links

    $this->Menu->AddLink('Categories', T('Categories'), 'categories/all');

    $this->Menu->AddLink('Facebook', T('Facebook'), 'http://www.facebook.com/');

  • @vrijvlinder said:
    KiritoBS
    Where are you planning to add this or expect it to appear?
    This would put the links in the menu :

    
     <?php
                    $Session = Gdn::Session();
                      if ($this->Menu) {
    $this->Menu->AddLink('Home', T('Home'), '/');
    $this->Menu->AddLink('Home', T('Activity'), '/activity');
    $this->Menu->AddLink('Home', T('Categories'), 'categories/all');
    $this->Menu->AddLink('Home', T('Discussions'), '/discussions');
    $this->Menu->AddLink('Home', T('Mobile View'), 'profile/mobile');
    }?>
    

    You can also add it like html just make sure it is in the right place so it does not mess up the other sections. My theme Heavy Metal has something like that, you could download it and study how it is put together then replicate it.

    By putting Home in the beginning of the links I am creating a submenu under Home, the links below home are < li > if you want them standalone links

    $this->Menu->AddLink('Categories', T('Categories'), 'categories/all');

    $this->Menu->AddLink('Facebook', T('Facebook'), 'http://www.facebook.com/');

    i expected it to appear in the menu, its suppossed to be a new design , basically, i wanted to redisign the menu but i've never used php before O.o

    look at this post css.zanime-mf.com/2012/09/menu-lavalamp-v2-css3.html there is an example of the menu i want to use at the end of the post (the post is in spanish, it doesnt really matter but if you want to read it, u can use google translator :P )

  • just use the CSS codes then :P

    simply find #Menu and replace it with these menu styles you want.

  • edited February 2013

    i expected it to appear in the menu, its suppossed to be a new design , basically, i wanted to redisign the menu but i've never used php before O.o

    looks like drop down to me, if what you want is a drop down then use the php links I put and change the css names to # Menu instead of #lava-menu then ad that css code to the theme custom.css

    As I explained before when you use it like this, the second link appears as a submenu.You can put as many as you want. You should install the CategoriesDropdown plugin so this works without having to put in all the html.

    (this would be the ul)

    $this->Menu->AddLink('Home', T('Home'), '/');

    (this would be the li)

    $this->Menu->AddLink('Home', T('Activity'), '/activity');

    If you want to make another link have a submenu :

    $this->Menu->AddLink('Discussions', T('Home'), '/');

    $this->Menu->AddLink('Discussions', T('Activity'), '/activity');

Sign In or Register to comment.