Coder Social home page Coder Social logo

How i add <li> class about donut HOT 9 CLOSED

yerbol89 avatar yerbol89 commented on May 28, 2024
How i add
  • class

    from donut.

  • Comments (9)

    amiyasahu avatar amiyasahu commented on May 28, 2024

    You can add it like this here -
    https://github.com/amiyasahu/Donut/blob/master/qa-theme/Donut-theme/qa-donut-layer.php#L500

    $this->content[ 'navigation' ][ 'main' ][ 'donut-theme' ] = array(
        'url'      => 'https://github.com/amiyasahu/Donut',
        'label'    => 'Donut theme',
        'selected' => 0,
    );

    You can change the label and URL as you wish. Also you can add links via q2a admin panel -> pages .

    from donut.

    yerbol89 avatar yerbol89 commented on May 28, 2024

    @amiyasahu bro help me.
    How i add li class?
    Please tell me class css add php code.

    1

    from donut.

    amiyasahu avatar amiyasahu commented on May 28, 2024

    Just use the PHP code I have given in my previous comment.

    from donut.

    yerbol89 avatar yerbol89 commented on May 28, 2024

    @amiyasahu Its true?

    function body_header() // adds login bar, user navigation and search at top of page in place of custom header content
            {
                if ( !empty( $this->content['navigation']['main'] ) ) {
                    $this->output( $this->donut_nav_bar( $this->content['navigation'] ) );
                    unset( $this->content['navigation']['main'] );
                }
                $this->content[ 'navigation' ][ 'main' ][ 'donut-theme' ] = array(
                    'url'      => 'https://github.com/amiyasahu/Donut',
                    'label'    => 'Donut theme',
                    'selected' => 0,
                );
            }

    from donut.

    amiyasahu avatar amiyasahu commented on May 28, 2024

    No @yerbol89 , use it like below -

    function body_header() // adds login bar, user navigation and search at top of page in place of custom header content
    {
        if ( !empty( $this->content['navigation']['main'] ) ) {
            $this->content[ 'navigation' ][ 'main' ][ 'donut-theme' ] = array(
                'url'      => 'https://github.com/amiyasahu/Donut',
                'label'    => 'Donut theme',
                'selected' => 0,
            );
    
            $this->output( $this->donut_nav_bar( $this->content['navigation'] ) );
            unset( $this->content['navigation']['main'] );
        }
    }
    ``

    from donut.

    yerbol89 avatar yerbol89 commented on May 28, 2024

    @amiyasahu thanks its work.
    After i'm 0 to 1 add class active. :)
    I add after selected 'selected' => 1, class 'classs' => 'radio' work fine.

    And i want one question?
    How i open link new target blank page?
    I add
    'target' => '_blank'
    but its not work.

    function body_header() // adds login bar, user navigation and search at top of page in place of custom header content
    {
        if ( !empty( $this->content['navigation']['main'] ) ) {
            $this->content[ 'navigation' ][ 'main' ][ 'donut-theme' ] = array(
                'url'      => 'https://github.com/amiyasahu/Donut',
                'label'    => 'Donut theme',
                'selected' => 1,
                'classs' => 'radio',
            );
    
            $this->output( $this->donut_nav_bar( $this->content['navigation'] ) );
            unset( $this->content['navigation']['main'] );
        }
    } 
    

    from donut.

    amiyasahu avatar amiyasahu commented on May 28, 2024

    Instead of changing the code, you should use Admin -> Pages -> Add Link option from admin panel. This will be less hassle. Sorry I misguided you to change the code.

    from donut.

    yerbol89 avatar yerbol89 commented on May 28, 2024

    @amiyasahu i use Admin -> Pages -> Add Link option from admin panel. But first Donut theme delete class in li and open target blank not work. I enable open link new window but target blank dont work.

    from donut.

    amiyasahu avatar amiyasahu commented on May 28, 2024

    I will check and fix in next version.

    from donut.

    Related Issues (20)

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.