We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36549
    • 572 Posts
    Hi,

    I want to style the default read more:
    <a title="Read more..." href="Mini-Blog-HOWTO.php">Read more...</a>

    How can i add a class to this and where is the text ’read more’ being generated from?

    Cheers

    J
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 4041
      • 788 Posts
      To achieve this:

      1. Since the link is contained inside a container with an id#, you’ll need to wrap it in a container with an id too so it will accept a style, so create a chunk with the following code (in this example I named mine ReadMoreLink)
      <div id="myclass"><a href="[+url+]" title="[+text+]" id="myclass">[+text+]</a></div>


      2. To change the "Read More..." text and the link template, add the following params to your ditto snippet call, replacing "More.." with your link text and "ReadMoreLink" with the name of the chunk you created:

      &truncText=`More...` &tplTrunc=`ReadMoreLink`


      3. You’ll need to add the styles to your css file, in this example I added this to my stylesheet:
      #myclass {
             margin-right: 20px;
             float:right;
             clear:both;
      }
      
      #myclass a, #myclass a:visited{
             text-align: right;
             color: #618200;
             border: dotted 1px #444444;
      }
      
      #myclass a:hover{
             color: #618200;
             border: dotted 4px #444444;
      }


      That should get you going, and it is a good idea to browse through the .css stylesheets in the assets/templates/modxhost/XXX.css folder as they have the examples for all the snippets. smiley
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 36549
        • 572 Posts
        Breezer, thanks a lot.

        Do you know how i can alter teh ’Archives’ title that’s wrapped in <h3> tags by default?

        Cheers
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 4041
          • 788 Posts
          Easiest thing to do is modify the assets/snippets/reflect/default.templates.php (the line you want is right at the very top) smiley
            xforum
            http://frsbuilders.net (under construction) forum for evolution
            • 36549
            • 572 Posts
            Thanks again Breezer...stupidly i never thought to look in the actual snippets folder rolleyes

            Cheers
              www.9thwave.co.uk
                 WEB | DESIGN | PRINT