We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36605
    • 70 Posts
    Ok, so I just put this in another thread (despite my other thread having it) because putting it in the other one is misleading. Now for the Qs:

    1. I’m trying to put in more CSS based on the tutorial on the wiki, and its doing nothing. Why?
    2. Is there a way I can just eliminiate all css natively in the menu and well...yeah?

    3. All I want is my basic nav: it was the color white and had .:. as a seperator between links. Whatever if I can’t get that, but this is starting to really get on my nerves... I’ve been trying to do this for like five hours now.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If you are modifying a .css file with no results, then you are most likely editing the wrong file. Do a "view source" on your page, and look in the head to see where the css files it is using are located. When I get myself confused as to which file is what (I am especially bad at getting a local version of a css file confused with the remote version), I’ll make a silly change that can’t be missed, like setting a background color to "yellow", just until I am sure that I am actually editing the correct items in the correct file.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 7231
        • 4,205 Posts
        1) as sottwell mentioned this is most likely that you are editing the wrong css or that it needs some specificity. If you don’t already, I recommend using the web developer plug-in for firefox to tweak your css live as well as other handy css related tools.

        2) Wayfinder by default has no style besides the active and last classes to identify the corresponding cases. If you followed the tutorial you need to style the horizontal menu by modifying the #menu elements, and the vertical menu with the #navigation elements.

        3) to get a menu that looks like this: page1 : page2 : page3 : ... you need to edit a wayfinder tpl. Wayfinder by default outputs an unordered list <ul>. To change the output you can edit each one of the building blocks to suit your needs. You can see the complete wayfinder docs at:
        http://www.muddydogpaws.com/development/wayfinder/parameters.html

        One way to get this menu you wil need to simply need to edit the &rowTpl. Create a chunk and name it whatever you want (I will name it myrowTpl). In this chunk put:
        <li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>  :  </li>


        And in your Wayfinder call add &rowTpl=`myrowTpl`. So it may look like:
         [!Wayfinder?startId=`0` &level=`1` &rowTpl=`myrowTpl`!]


        Then you need to add display: inline; to the css for the menu. The catch is that you will have a : at the end of the last menu as well. There are other ways to do this with css by using a background image which you could disable on the last menu item. Here is a good read on lists: http://www.alistapart.com/articles/taminglists/

        If you don’t want to use a list you can edit the outerTpl and the rowTpl to get the output you want.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 3749
          • 24,544 Posts
          Once you’ve found the right .css file, you can control the styling of the menu items by putting something like the following in your .css file (you may have to change #menu to #navigation). It won’t give you the vertical separators, but if you adjust the colors and spacing, you may be able to let the background show through for separation.

          Otherwise, you could hack the Wayfinder snippet code slightly to put the separators in.

          #menu {
          margin:0 -1px;
          text-align:right;
          }
          
          #menu a {
          text-decoration:none;
          font-weight:bold;
          color:#336633;
          }
          #menu a.current {
          color:#999999;
          }
          #menu a.current:hover {
          background-color:#666666;
          color:#444444;
          }
          #menu a:hover {
          color:#003366;
          background-color:#cccccc;
          }
          
          
          #menu ul {
          	font-family:Geneva, Arial, Helvetica, sans-serif;
          	font-size:12px;
          	text-align:center;
          	list-style: none;
          	padding:10px 0px 10px 0px;
          	margin:0px 0px 0px 0px;
          }
          
          #menu ul li{
          
          	display: inline;
          	margin-left:3px;
          	margin-right:3px;
          	
          	color:#000000;
          	background-color:#006666;
          }
          


          For further ideas, visit the forum section "You and Your Sites." Go to some of the sites and find a menu you like (most are Wayfinder menus).

          Select "view source" in your browser and see how the menu appears in HTML.

          Then look for the .css file at the top of the source page. Usually, you can paste the url for the .css file into your browser’s address window and view the .css as well. That way you can see how it was done.

          It’s not fair play to just steal the other person’s code, but we all get ideas from each other’s sites. Also, you can often use an e-mail link at the site to ask the page author for permission to use some of the .css code on your page.

          Bob
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 36605
            • 70 Posts
            Thanks for all the help! I know I’ve asked on like three different boards here, and am probably a pest, but I’m still not quite getting it. (And I have web developer wink)

            1) I get what you’re saying, but what do I use in the CSS to specifiy it? I’m assuming I’m doing it wrong...
            2) I was able to find that part out (though I didn’t even realize there was a tutorial until I google searched)
            3) I tried that but it’s not doing anything.

            Here’s my template and css... This’ll probably help more to look at. Also, the site I’m trying to convert is BSN70.com, so if you want to look at the non-template version to see what I’m talking about, its there.
            -------------------
            Template:
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
            <title>[(site_name)] | [*pagetitle*]</title>
            <link rel="stylesheet" href="[(base_url)]assets/templates/bsn1/bsn.css" type="text/css" media="screen" /><base href="[(site_url)]" /></head>
            <body topmargin="0" leftmargin="0" rightmargin="0">
            <div id="container" align="center">
            <div id="nav"><span class="menu"> [!Wayfinder?startId=`0` &level=`1` &rowTpl=`myrowTpl`!]</span></div>
            
            <div id="banner"></div>
            <div id="content"><h2 class="style2" style="2">[*longtitle*]</h2>
              <p class="style2" style="2">[*content*]</p>
            </div>
            <div id="footer">
              <center>
                <span class="style1"><font size="-4">© BSN AZA #70<br />
                  All Rights Reserved      </font></span>
              </center>
            </div>
            </div>
            </body>
            </html>
            

            CSS (really need to organize it, and I also didn’t know if I was doing it right for some of the menu stuff...):
            #nav ul li {  display: inline; }
            .nav ul li {
            	color: White;
            }
            .style1 {
            	font-family: Tahoma, Arial, Sans-serif;
            	font-size: 14px;
            	color: #000000;
            	marker-offset:inherit;
            }
            .style2 { font-family: Tahoma, Arial, Sans-serif; }
            html,body {
            	background-color: #669999;
            	text-align: center;
                height: 100%;
            	margin:0;
            	padding:0;
            }
            .style4 {
            	font-size: 9px
            }
            p { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; }
            #container {
            	width: 700px;
            	height: 100%;
            	position:relative;
            	margin:auto;
            	height: 100%;
            	border-bottom: 3px solid #336600;
            	border-left: 3px solid #336600;
            	border-right: 3px solid #336600;
            	border-top: 1px solid #336600;
            	background-color:#FFFFFF;
            	text-align:center;
            	margin-bottom:0;
            }
            #banner {
            width: 700px;
            height: 111px;
            background-image: url(bsn_05.gif);
            border-bottom:3px solid #CCCCCC;
            }
            #welcome {
            	position:absolute;
            	left: 555px;
            	top: 89px;
            }
            .welcome {
            	font-family:Tahoma, Arial, Sans-serif;
            	font-size:12px;
            	font: #FFFFFF;
            	font-weight:bold;
            }
            #nav {
            	background-image: url(bsn_02.gif); 
            	width:700px; 
            	height:38px;
                    margin-top: 0px;
            }
            #content {
            	min-height: 200px;
            	background-color: #FFFFFF;
            	margin-top: 15px;
            	margin-bottom: 15px;
            	margin-left: 5px;
            	margin-right: 5px;
            }
            #news {
            	background-color: #ccffff;
            	border: solid;
            	border-width: 2px;
            	border-color: #66CCCC;
            	text-align: center;
            	width: 430px;
            }
            .news {
            	text-align: inherit;
            	font-family: Verdana, Arial, Helvetica, sans-serif;
            }
            #spacer {
            height:10px;
            width:700px;
            min-height:10px;
            }
            .menu {
            	font-family:Tahoma, Arial, Sans-serif;
            	font-size:14px;
            	font-weight:bold;
            	color:#ffffff;
            	height:15px;
            	margin-left:10px;
            	text-align:left;
            	border:0px;
            }
            a.menu:active {
            	color:#FFFFFF;
            }
            a.menu:link {
            	color:#FFFFFF;
            }
            a.menu:visited {
            	color:#FFFFFF;
            	text-decoration:none;
            }
            a.menu:hover {
            	text-decoration:underline;
            }
            #footer {
                clear: both;
            	text-align: center;
            	font:Tahoma, Arial, Sans-serif;
            	font-size:9px;
            	margin-bottom:0;
            }
            
              • 3749
              • 24,544 Posts
              For starters, you have nav ul li in your css more than once. Each css identifier can only appear once.

              You can have:
              .nav {}
              .nav ul {}
              .nav li {}

              but you can’t have
              .nav {}
              #nav {}
              .nav {}

              Also, you need to get class versus id straight.

              Both these attributes can be used with any HTML element. A CLASS is preceded by a dot (.), and an ID with a hash mark (#), then the CLASS or ID name and the declaration.

              With the ID selector you identify an element to be an *unique instance* in a document so you have be confident that anything you designate with "id=" will only appear once in any document.

              A CLASS selector, identified with "class=" can appear over and over in a document.

              CSS is kind of a black art, imho. I’m no expert at it and I hate doing it. On the plus side, once you have a css file that works, you can make small tweaks to it and change the look of your whole site.

              Instead of:
              #nav ul li {  display: inline; }
              .nav ul li {
              	color: White;
              }

              you want:
              .nav ul li {  
                   display: inline; 
                   color: #ffffff;
              }


              If you might have more than one nav on a page, you’ll want to change .nav to #nav and use class="nav"

              If you get a good .css editor (e.g. dreamweaver), it will prompt you with all the attributes that you can put in any section and pop up a color chart to help you set the colors.

              Hope this helps.

              Bob

                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 36605
                • 70 Posts
                Thanks, I actually just didn’t know really what ul and li were till just late last night... And even then I was confused as to how you applied them in css, so thank you for that! Also though, I do know classes and ids, but thanks for the reminder anyways there wink

                Also, I didn’t realize this, but divs can’t appear twice in a page? I always thought they could if you had, for instance, a div made for a little piece of a sidebar...hmm

                Edit: The inline doesn’t work correctly like that actually...And I need to change the link colors; all the other text is fine.

                Edit 2: Finally fixed it! Turns out I was doing my link styling wrong. I had nav.a: active, when it’s .nav a:active

                Thanks guys!
                  • 7231
                  • 4,205 Posts
                  Good to see you got it working, CSS is one of those brain twisters but once you get it it is great.


                  Also, I didn’t realize this, but divs can’t appear twice in a page? I always thought they could if you had, for instance, a div made for a little piece of a sidebar...hmm
                  I think you misunderstood, you can have as many <div> as you need. What you cant repeat on the same page are IDs. For example you can have only one <div id="idname"> but you can have several <div class="classname">.

                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don&#39;t know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 36605
                    • 70 Posts
                    Quote from: dev_cw at Oct 15, 2007, 07:57 PM

                    Good to see you got it working, CSS is one of those brain twisters but once you get it it is great.


                    Also, I didn’t realize this, but divs can’t appear twice in a page? I always thought they could if you had, for instance, a div made for a little piece of a sidebar...hmm
                    I think you misunderstood, you can have as many <div> as you need. What you cant repeat on the same page are IDs. For example you can have only one <div id="idname"> but you can have several <div class="classname">.



                    That’s what I meant wink But still very interesting...Never realized that...
                      • 7231
                      • 4,205 Posts
                      Just making sure grin

                      Anyway here is a great reference for css and html:
                      http://www.htmldog.com/guides/cssintermediate/classid/

                        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                        Something is happening here, but you don&#39;t know what it is.
                        Do you, Mr. Jones? - [bob dylan]