WordPress Plugin Development - Part 18 - Admin Tabs in Vanilla JS

Поделиться
HTML-код
  • Опубликовано: 10 дек 2024

Комментарии • 77

  • @HarmopdenAkker
    @HarmopdenAkker 8 месяцев назад

    Excellent tutorial series so far. After 6 years (now using WordPress 6.4.3), everything still seems to work exactly right.

  • @jsr7599
    @jsr7599 4 года назад +3

    Bizarrely low patron count, will definitely contribute if I can turn this knowledge into revenue.
    Thank you for not being a 'magician' and showing exactly how everything works, hope karma gets back to you quickly :)

    • @alecaddd
      @alecaddd  4 года назад

      Eheh, thank you so much

  • @bryanfahrenheit4596
    @bryanfahrenheit4596 6 лет назад +1

    This is a nice little added bonus. I can achieve this same tab layout using Bootstrap but since you can't use Bootstrap with Wordpress, this part of the tutorial is extra helpful!

    • @alecaddd
      @alecaddd  6 лет назад +1

      Thanks, I'm happy it was helpful, lots of users hated the digression to a sort of another topic :D

    • @kriscloutier4537
      @kriscloutier4537 5 лет назад

      You actually can! I am using it while following this tutorial! Go to your Enqueue.php and add these lines:
      wp_enqueue_style( 'bootstrapcss', 'stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css' );
      wp_enqueue_script( 'bootstrapjs', 'stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js' );

    • @LetsNaiDa
      @LetsNaiDa 5 лет назад

      @@kriscloutier4537 Maybe it would be better to download bootstrap and put it into the plugin itself?... cause of performance ^^'

  • @tuleikhaus4101
    @tuleikhaus4101 3 года назад

    Great, great series!!! I'm very happy to be following alongside, doing my own independent plugin idea, and not really following everything exactly, but you've explained everything so well that I'm able to successfully go my own direction without everything falling off the rails. Thanks for a great tutorial series!!

  • @skepticalCoder
    @skepticalCoder 5 лет назад

    Now onto the .js bit....and finally done. Thanks for another great tutorial!

  • @animeshsahu9937
    @animeshsahu9937 7 лет назад +2

    If you are using jquery instead of common javascript then do not use tabs[i] as selector because internally it means tabs.get(i) that returns raw dom on which you cannot use selector .on, instead using 'tabs.eq(i)' that returns jquery object, so you can extent the work using .on, so this should be tabs.eq(i).on('click',switchTabs); yes js use raw data to work on so it would be better option but jquery works with object made by jquery itself. So this method should be adopted.
    Happy Coding!

    • @alecaddd
      @alecaddd  7 лет назад +1

      Thanks for the heads up

  • @free2idol1
    @free2idol1 4 года назад +1

    11:38 Anyone know why putting float: left; at .nav-tabs > li > a makes the spacing larger?

    • @maxcanzonieri
      @maxcanzonieri 4 года назад +1

      simply because an item with float property will become automatically with property display: block;

    • @free2idol1
      @free2idol1 4 года назад

      @@maxcanzonieri thanks for the answer, I've been quite confused about that for a while. Do you know any source telling more about that stuff?

    • @maxcanzonieri
      @maxcanzonieri 4 года назад

      ​@@free2idol1 you're welcome. Not properly... try to study the display and float properties of CSS to understand better it. It's the only way to understand better...You have to understand that all items have specific property on CSS ... for example: if you use display:inline-block you know that the items take specific rules and comportment.
      If you use the rule float the item became in block element and the block element has determinate rules. If you use a block element you never will never write the with property for example because it heredity from browser

  • @acerrusm
    @acerrusm 7 лет назад +1

    Looking forward to see new tuts. Thanks!

    • @alecaddd
      @alecaddd  7 лет назад

      New WP tutorial coming tomorrow :D

  • @stpengineering
    @stpengineering 6 лет назад +3

    ciao mamma sono alla lezione 18 e tutto procede bene :D

  • @MarvelousMaterial
    @MarvelousMaterial 7 лет назад +1

    Alessandro, are you going to make a video about validation and sanitization of input?

  • @Alejandrom3
    @Alejandrom3 4 года назад +1

    If someone has OCD like me and want make he pane background not overflowing, just add the box-sizing property like this:
    .tab-content > .tab-pane {
    box-sizing: border-box;
    float: left;
    width: 100%;
    display: none;
    }

  • @eslamzanaty7646
    @eslamzanaty7646 6 лет назад +3

    Man .. I really love you so much ❤

  • @bryceleekelsey
    @bryceleekelsey 6 лет назад +6

    mystyle.css is not loading. I've checked and triple checked the code. Everything is identical to part 18. If I load the example for this module, the links don't display at the top either.

    • @alecaddd
      @alecaddd  6 лет назад

      Did you check my source code on GitHub? Even if you copy that code nothing works? Do you have any errors in your console? Are you sure composer is properly installed and your classes are being initialized properly?

    • @bryceleekelsey
      @bryceleekelsey 6 лет назад +2

      So I stopped for the day and started again this morning. Went through everything. Double checking composer, enqueue, etc. But for some reason and I don't know why, it just started to work. I didn't make a single change. I guess the point is moot now. Time to press on...

    • @dronesim
      @dronesim 6 лет назад +19

      I have the same problem here, css is not loading, I mean it is loaded when you inspect the network and reload the page but there are no visible changes.
      UPDATE: After some debugging I found the problem:
      Instead of writing
      wp_enqueue_style('mypluginstyle', $this->plugin_url . 'assets/mystyle.css');
      you have to set a slash right before the path of the assets folder so it should be like this:
      wp_enqueue_style('mypluginstyle', $this->plugin_url . '/assets/mystyle.css');
      Do the same for the JS file.
      I think it has some differences between Mac OS and Windows.

    • @seoalphait9660
      @seoalphait9660 6 лет назад +1

      Thanks! Was having that issue and did not see it until I read your comment

    • @sofianehoudjedje531
      @sofianehoudjedje531 6 лет назад +1

      KnowledgeBase thanks bro it works greate

  • @vaishnavia.n.312
    @vaishnavia.n.312 11 месяцев назад

    Hello Alex, The javascript is not working in my plugin folder, the file is being ,loaded when I check the network tab, any idea / solution is appreciated.

  • @PythonicPath1
    @PythonicPath1 5 лет назад

    Hey Thanks Alex for this great videos they still help alot of ppl :) like me, i started following this series for plugins.
    my question i know html and basic css, shall i learn JS basics before continuing this series ?
    also i need create a rich user dashboard and admin page plugin , i may need JS much?
    Thanks!

  • @vinodtroeon5947
    @vinodtroeon5947 3 года назад

    i want to create my plugin setting pageg in submenu then how can i do it? pls guide..

  • @waltermazzola1596
    @waltermazzola1596 7 лет назад +1

    Hi, is there any change you can create a tutorial about Woocommerce Plugin Development?

    • @alecaddd
      @alecaddd  7 лет назад

      Not sure I will do that, but the process and methods are pretty much the same as regular plugin development.

  • @ylebrac
    @ylebrac 6 лет назад

    Hello Alessandro, could you tell which package you are using inside Sublime Text 3 to manage JS auto completion?

    • @alecaddd
      @alecaddd  6 лет назад

      I don't remember as I switched to VSCode now. Try to search for Javascript autocomplete or something like that. Cheers

  • @sudhakarsudha9655
    @sudhakarsudha9655 7 лет назад +1

    vanila js interesting dude!!!

    • @alecaddd
      @alecaddd  7 лет назад

      Yup, super light and easy to use without the necessity of any framework or compiler.
      Cheers

  • @TimothyCareyDV
    @TimothyCareyDV 5 лет назад

    At which Video did you add the following line to admin.php

    • @alecaddd
      @alecaddd  5 лет назад

      I don't remember, sorry.
      You can do a research on GitHub and see when it was implemented first.

    • @MrNaveenr9
      @MrNaveenr9 4 года назад

      part 17c

  • @iamasir0988
    @iamasir0988 2 года назад

    Hi, I have a problem
    Almost all of my code is the same as that of Lesson 18, but the style and script do not work properly
    I can even see these two in the network

    • @lenny99mc
      @lenny99mc 2 года назад

      same here

    • @Eswarsaiteja
      @Eswarsaiteja Год назад

      Here is the solution as Go to Admin.php file and then go below u can find this public function setFields()
      {
      $args = array(
      array(
      change the 'label_for' To 'label-_id' . so u can view the tabs transition

    • @Eswarsaiteja
      @Eswarsaiteja Год назад

      @@lenny99mc check once

  • @MrColins710
    @MrColins710 4 года назад

    Thanks a lot!

  • @sudhakarsudha9655
    @sudhakarsudha9655 7 лет назад

    Hey do u have any other ideas of diffrent theme sin wordpress development like booking or classified

    • @alecaddd
      @alecaddd  7 лет назад

      Mh, I'm not sure I understand your question, what type of theme are you looking to build?

    • @sudhakarsudha9655
      @sudhakarsudha9655 7 лет назад

      bike booking or car booking or room booking like these tutorial

  • @skalippanbalippan6972
    @skalippanbalippan6972 7 лет назад +3

    waiting for the part where we can store data to the database

    • @alecaddd
      @alecaddd  7 лет назад

      With the Settings API work we did, the data in those fields is already getting stored in the DB.
      Are you looking for something specific?

    • @skalippanbalippan6972
      @skalippanbalippan6972 7 лет назад

      Yes, I am working a lot with web scraping but never use it with Wordpress (I am using $wpdb), just wondering if there is a better way.

    • @rntgm3650
      @rntgm3650 7 лет назад +1

      maybe create a new table

  • @shaktigoyal1450
    @shaktigoyal1450 3 года назад

    Can’t we use the bootstrap to develop the admin section?

  • @rapinder7461
    @rapinder7461 7 лет назад +1

    Good! Thanks

    • @alecaddd
      @alecaddd  7 лет назад

      You're very welcome :D

  • @homamhomam1879
    @homamhomam1879 6 лет назад +1

    great

  • @hardcodd
    @hardcodd 6 лет назад +1

    Perfect!!!

  • @larryseymour4174
    @larryseymour4174 3 года назад

    anyone else get a space between tab list and the tab content?

  • @rntgm3650
    @rntgm3650 7 лет назад

    need more tuts

  • @RudyGayRaptors
    @RudyGayRaptors 6 лет назад +1

    Hi @Alessandro Castellani, is there any reason why you don't use the default nav-tab-wrapper that is provided by wordpress? Any cons of using nav-tab-wrapper?

    • @alecaddd
      @alecaddd  6 лет назад +1

      No specific reason, I just wanted to show how to code everything from scratch :D