We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28528
    • 31 Posts
    This is a mega-noob question but here goes...

    I have a basic html table containing a list of hyperlinks to other pages within the site. But I only want a link to be shown ’if’ the page being linked to is ’published’.

    Is this possible with a simple bit of code?

    Steve
      • 27330
      • 884 Posts
      it depends how you plan to add the links. if you hard code them I can’t think of an easy way to do it, but if wayfinder for example generate your links you can choose to hide unpublished docs.
        • 10487 MODX Staff
        • 1,535 Posts
        I echo sinbad, Wayfinder or Ditto is the way to go (depending on which best fits your requirements) - you could easily use the templating options in both of these to do what you want them to do.
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 16183
          • 1,390 Posts
          Hmmm,

          Maybe I am misunderstanding this, but doesn’t Wayfinder not show unpublished documents by default? And I can’t recall a parameter to change that...or? I know Ditto has a published docs parameter though.

          cheers/k
            • 10487 MODX Staff
            • 1,535 Posts
            @kongondo Yeah, Wayfinder only shows published documents - but there is this patch to make it behave differently.

            To expand on my previous comment (to clarify to steve_c about what choice to make), the choice of whether to use Wayfinder depends if the listed documents are structured hierarchically or whether they are spattered about the site - the latter would be where Ditto becomes handy to generate the listing with the finer control that Ditto provides over which documents get included in the listing.
              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 16183
              • 1,390 Posts
              Quote from: garryn at Sep 05, 2009, 09:17 PM

              @kongondo Yeah, Wayfinder only shows published documents - but there is this patch to make it behave differently.


              Garry,

              Cheers. Can’t recall seeing that b4

              /k