MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Alignment with module "random_quotes"

    Scheduled Pinned Locked Moved Troubleshooting
    16 Posts 3 Posters 12.1k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q Offline
      qqqqqqqq
      last edited by

      I’m using the module random_quotes to display pre-defined quotes from a local file.
      Now, the problem is that I’ve set it’s position to ‘top_right’ & aligned it to the right so that it appears just below the current weather module; but instead of appearing in 2-3 rows, it it blocking the calendar module (currently hidden).

      I know I have to just change the margin value in the random_quotes.js, but I can’t seem to get it right. Here is the image.

      0_1487352887035_random_quotes module.png

      strawberry 3.141S 1 Reply Last reply Reply Quote 0
      • strawberry 3.141S Offline
        strawberry 3.141 Project Sponsor Module Developer @qqqqqqqq
        last edited by

        @qqqqqqqq try that in custom.css

        .random_quotes {
          width: 250px;
        }
        

        Please create a github issue if you need help, so I can keep track

        1 Reply Last reply Reply Quote 0
        • Q Offline
          qqqqqqqq
          last edited by

          My custom.css is a blank file.
          Is this correct? If yes, then it’s not working.

          /*****************************************************
           * Magic Mirror                                      *
           * Custom CSS                                        *
           *                                                   *
           * By Michael Teeuw http://michaelteeuw.nl           *
           * MIT Licensed.                                     *
           *                                                   *
           * Add any custom CSS below.                         *
           * Changes to this files will be ignored by GIT. *
           *****************************************************/
          
           body {
           .random_quotes {
            width: 200px;
            }
          }
          
          
          strawberry 3.141S 1 Reply Last reply Reply Quote 0
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @qqqqqqqq
            last edited by

            @qqqqqqqq delete body { and the last }

            Please create a github issue if you need help, so I can keep track

            1 Reply Last reply Reply Quote 0
            • Q Offline
              qqqqqqqq
              last edited by

              Works like a charm!
              Thank you SOOO much.

              Can I use this to set margins for other modules as well? If yes, how?
              How do I set their alignment?

              strawberry 3.141S 1 Reply Last reply Reply Quote 0
              • strawberry 3.141S Offline
                strawberry 3.141 Project Sponsor Module Developer @qqqqqqqq
                last edited by

                @qqqqqqqq to set margins which is the outer distance to another element

                .MODULENAME {
                  margin: 10px 5px 15px 20px; //10px top, 5px right, 15px bottom, 20px left
                }
                

                Please create a github issue if you need help, so I can keep track

                Q 1 Reply Last reply Reply Quote 0
                • Q Offline
                  qqqqqqqq
                  last edited by

                  Okay, understood.

                  Are you familiar with the “stocks/MMM-Stocks” module? Because I’ve having trouble with them too.

                  I’ve got few more questions, should I create new threads for them, or can I PM you or something since you seem like an expert at MM2. ;)

                  strawberry 3.141S Mykle1M 2 Replies Last reply Reply Quote 0
                  • strawberry 3.141S Offline
                    strawberry 3.141 Project Sponsor Module Developer @qqqqqqqq
                    last edited by

                    @qqqqqqqq because it’s related to another module I suggest to create a new thread, so users who have the same issue can find it via search. Benefit for you, you can also get opinions from others, but you can also send a pm.

                    Please create a github issue if you need help, so I can keep track

                    1 Reply Last reply Reply Quote 0
                    • Mykle1M Offline
                      Mykle1 Project Sponsor Module Developer @qqqqqqqq
                      last edited by

                      @qqqqqqqq said in Alignment with module “random_quotes”:

                      you seem like an expert at MM2.

                      Oh, he is. :thumbsup:

                      Create a working config
                      How to add modules

                      1 Reply Last reply Reply Quote 1
                      • Q Offline
                        qqqqqqqq @strawberry 3.141
                        last edited by qqqqqqqq

                        @strawberry-3.141

                        I’m trying to align this module to right cuttently it appears like this

                        alt text

                        But there is no alignment tag.
                        I also tried to add align attribute to the HTML tag in the .js file. But even that doesn’t work.

                        Also, the module has a header property which isn’t showing up. It works if I add it to the HTML tag, but not via the config file.

                        strawberry 3.141S 1 Reply Last reply Reply Quote 0
                        • strawberry 3.141S Offline
                          strawberry 3.141 Project Sponsor Module Developer @qqqqqqqq
                          last edited by

                          @qqqqqqqq revert your changes in your js file (git checkout MMM-SystemStats.js)

                          custom.css

                          /* aligns the table to the right */
                           .MMM-SystemStats table {
                            width: initial;
                            float: right;
                          }
                          
                          /* aligns all columns to the left within the table */
                          .MMM-SystemStats td {
                            text-align: left !important;
                          }
                          

                          config.js

                          {
                            module: 'MMM-SystemStats',
                            position: 'top_right', // This can be any of the regions.
                            classes: 'small dimmed', // Add your own styling. Optional.
                            header: 'My own MMM-SystemStats header!',
                            config: {
                              updateInterval: 10000,
                              animationSpeed: 0,
                            },
                          },
                          

                          The comment in the readme for the custom header is outdated, the author wants to create an update this weekend, therefore the css rules could break, but he might want to add this as a config option and remove the old comment @BenRoe

                          Please create a github issue if you need help, so I can keep track

                          Q 1 Reply Last reply Reply Quote 2
                          • Q Offline
                            qqqqqqqq @strawberry 3.141
                            last edited by

                            @strawberry-3.141

                            Like always, works perfectly!!!

                            The separator under the heading “My own MMM-SystemStats header!” sticks out of the table to the left; which kind of hurts my eyes.

                            @strawberry-3.141 said in Alignment with module “random_quotes”:

                            @qqqqqqqq to set margins which is the outer distance to another element

                            .MODULENAME {
                              margin: 10px 5px 15px 20px; //10px top, 5px right, 15px bottom, 20px left
                            }
                            

                            Even the above command doesn’t do it.

                            strawberry 3.141S 1 Reply Last reply Reply Quote 0
                            • strawberry 3.141S Offline
                              strawberry 3.141 Project Sponsor Module Developer @qqqqqqqq
                              last edited by

                              @qqqqqqqq because the module gets stretched to the width of the widest module in a region, to fix that, you can manually set the width for the module in custom.css

                              .MMM-SystemStats {
                                width: 200px;
                              }
                              

                              Please create a github issue if you need help, so I can keep track

                              Mykle1M 1 Reply Last reply Reply Quote 1
                              • Mykle1M Offline
                                Mykle1 Project Sponsor Module Developer @strawberry 3.141
                                last edited by yawns

                                @strawberry-3.141

                                I took what you’ve been teaching qqqqqqqq and applied it to my own custom.css file, which I wanted justified to the left, instead of the right, in his case. I had also played with the .js file. I know this is wrong, and I know why now, but I am determined to do things the right way so I reverted back to the original .js file. It is a good feeling when things start to make sense.

                                Taking what I learned from you, I applied it to my custom.css file below.

                                .MMM-SystemStats {
                                  width: 175px;
                                }
                                
                                .MMM-SystemStats td {
                                  text-align: left !important;
                                }
                                

                                And that produced this.
                                0_1487515289121_nice.JPG

                                Perfectly aligned and justified.

                                Even when you’re helping someone else, you’re helping me. God, you’re freakin awesome!

                                Create a working config
                                How to add modules

                                1 Reply Last reply Reply Quote 0
                                • Q Offline
                                  qqqqqqqq
                                  last edited by

                                  @Mykle1 Nice! I actually like how you’ve put it. Thanks for the idea! :p

                                  0_1487517720856_Mirror stats.PNG

                                  @strawberry-3-141 Thanks, that helped.

                                  Mykle1M 1 Reply Last reply Reply Quote 0
                                  • Mykle1M Offline
                                    Mykle1 Project Sponsor Module Developer @qqqqqqqq
                                    last edited by

                                    @qqqqqqqq said in Alignment with module “random_quotes”:

                                    @Mykle1 Nice! I actually like how you’ve put it. Thanks for the idea!

                                    Yes, my layout seems to be in high demand. :thumbsup:

                                    Create a working config
                                    How to add modules

                                    1 Reply Last reply Reply Quote 0

                                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                    With your input, this post could be even better 💗

                                    Register Login
                                    • 1 / 1
                                    • First post
                                      Last post
                                    Enjoying MagicMirror? Please consider a donation!
                                    MagicMirror created by Michael Teeuw.
                                    Forum managed by Sam, technical setup by Karsten.
                                    This forum is using NodeBB as its core | Contributors
                                    Contact | Privacy Policy