We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10117
    • 6 Posts
    I’m going through the tutorials in the eBook MODx Web Development (endorsed on the MODx site) and can’t figure out how to format variables that are used in the book. In particular is the variable [*pagetitle*] In the example, the author shows it as being formatted in what appears to be a header style but when I view my work in a browser the title is totally unformatted. As you can see in the attached screenshot the page is picking up the page title (home) but it is not formatted. Where would I format that? I can’t see anything in the css file that would appear to address that formatting.

    Any help would be appreciated.

    Thanks.

    Fred
      • 3749
      • 24,544 Posts
      "Endorsed" might be too strong a word here. It’s listed as a book on MODx (along with all other known books on MODx), but I don’t think it has any official status.

      To answer your question, though, you could put this in your template:

      <h1>[*pagetitle*]</h1>


      Then use your CSS file to specify how <h1> will be rendered.

      BTW, it’s more common to use [*longtitle*] there and use [*pagetitle*] in the <head> section of the template:

      <title>[*pagetitle*]</title>


      You’re free to do what you want, of course.
        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
        • 10117
        • 6 Posts
        Figured that one out. The code in the book doesn’t show it wrapped in a header tag - <h1>[*pagetitle*]</h1> Did that and it works. More questions which I’ll ask in a separate post.
          • 10117
          • 6 Posts
          Hey BobRay, our posts crossed. I posted before reading yours. Thanks for the suggestions.

          Fred
            • 3749
            • 24,544 Posts
            I’m glad you got it worked out. smiley
              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