We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47401
    • 295 Posts
    if *id is showing on all pages including the home page, the *id echo's out http://domain-name.com/http://www.domain-name.com

    why is this? on all other pages, the *id shows the correct page name i.e http://www.domain-name.com/page-name-1.html (with friendly URL's on)
      • 24865
      • 289 Posts
      You mean when you're generating a URL? Like [[~[[*id]]]] for example?

      Normally, people are used to only using [[~[[*id]]]]. When you want to force the domain, you need to be aware that there is a setting for that. No need to prefix all URLS with, i.e. [[++site_url]][[~[[*id]]]]. This is imply achieved with [[~[[*id]]?scheme=`full`]] or by changing the System Setting "link_tag_scheme" to 'full' or even 'https'. smiley

      An example of your superduperubersecret HTML would be enough to solve it for you. smiley
        @MarkGHErnst

        Developer at Adwise Internetmarketing, the Netherlands.
        • 47401
        • 295 Posts
        Hi thanks for your quick response. how can I get it just to echo out the page name, and if the page is on the home page, then dont echo anything out?
          • 47401
          • 295 Posts
          would i need to include if statement, something like if *id = 1 then '' else show the page name?
            • 24865
            • 289 Posts
            You should be using [[*pagetitle]] for the resource and [[+pagetitle]] for the resources when iterating via chunks. [[*id]] only echo's the ID of the resource, which is an AUTO_INCREMENT ID from the database.

            If you're working on a specific page among others with the same template, the most easy solution would be [[*id:neq=`[[++site_start]]`:then=`[[*pagetitle]]`]].
              @MarkGHErnst

              Developer at Adwise Internetmarketing, the Netherlands.
              • 47401
              • 295 Posts
              oh right, ok. im using this at the moment [[~[[*id]]]]
                • 47401
                • 295 Posts
                ok, this seemed to do the trick:

                [[*id:is=`1`:then=``:else=`[[~[[*id]]]]`]]

                if the page id is 1 (home page) then dont echo out anything, else if the page being viewed is on any other page, show the page name smiley

                Thanks for your help with this
                  • 3749
                  • 24,544 Posts
                  Using a one-line snippet would give you faster page loads:

                  [[!PageTitle]]



                  <?php
                  /* PageTitle snippet */
                  return ((int) $modx->resource->get('id')) === 1 ? "" : $modx->resource->get('pagetitle');
                    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