We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    Could you provide an example where the current page would be listed? Additionally, "omit the title link and only output the title itself" this can easily be done via a tpl
      • 18436
      • 135 Posts
      Quote from: Mark at Jun 09, 2006, 09:07 AM

      Could you provide an example where the current page would be listed?

      http://www.swellguys.co.za/issues/2006/may/articles/super-charged/waveknowledge.html

      In this example I’m using a newslisting snippet call to show articles within the issue as well as page children further down the sidebar, what I’d like to do is style the link of the current page differently to help people visually notice where they are. (currenly updating all my old newslisting snippets to ditto)

      http://www.swellguys.co.za/issues/2006/may/articles/super-charged.html

      if you visit this parent document then no children/siblings are listed in the sidebar but the article block is still visible and here I’d like to style the link to current document differently as I mentioned above.

      Quote from: Mark at Jun 09, 2006, 09:07 AM
      Additionally, "omit the title link and only output the title itself" this can easily be done via a tpl

      I don’t want to have to call another tpl file. In this instance I’d rather omit the enclosing href tag around the title that’s generated by the snippet so it’s no longer a link but simply text.
        • 18397
        • 3,250 Posts
        Please file a feature request so that the next release of Ditto will have the ability to identify the current document. Secondly, that is exactly what &tpl chunks are for. You only need to create one and include it in the call.
          • 18436
          • 135 Posts
          Quote from: Mark at Jun 09, 2006, 10:14 AM

          Please file a feature request so that the next release of Ditto will have the ability to identify the current document. Secondly, that is exactly what &tpl chunks are for. You only need to create one and include it in the call.

          Perhaps we’re misunderstanding each other here, how am I going to let Ditto know what chunk it should call when it encounters an item within it’s links array? Since the array is used to generate the output I don’t see the necessity of yet another chunk/tpl for changing the format... Ditto should simply append a ’class="$activeLink"’ into the href tag which gets placed into the appropriate placeholder within the tpl file.

          Or am I missing something here? Gonna try and figure this out tonight.
            • 18397
            • 3,250 Posts
            Ok, right now there are multiple tpl vars--- one for the first, last, alternating rows, and a general tpl (used if others are not set). You can specify one (tpl) or all to get the effect of customizing the posts HTML structure based on position. I am saying that I would add one more for the current document so that you could change the HTML structure for that particular post.
              • 1549
              • 20 Posts
              Quote from: Mark at Jun 08, 2006, 05:13 PM

              The problem is that the snippet considers the image tag as characters...

              I will see if I can figure out a way to remove the tags from the character count but in the meantime just increase the count to account for the image tag.

              I increase the &truncLen to more characters and it just shows me the whole document ( all of the text, not summarized ), and the read more link ( which, by the way has problems with not-english letters )
                • 18436
                • 135 Posts
                The additional tpl would indeed be a helpful addition. Whilst on the train home I was thinking about your previous comment and realised I needed to take a closer look at the code and situation so the below scenario is to help clarify things in my mind a bit more.

                Scenario:

                >> Ditto is used to output a list of pages within doc.id22 either as a sidebar block or as a blog entry/ childsibling list
                >> User loads doc.id33 which is a child of doc.id22 and the list of children.doc.id22 is still shown.
                >> Item 4 on the list is doc.id33 which is the current page so it should either be displayed differently via a new tpl or through the snippet which appends a custom class to the title link (that being the link using the name of the page and not the read more link)

                Both approaches have their merits: a new tpl gives the site admin some flexibility in terms of formating the output but what if he/she doesn’t need the flexibility or isn’t comfortable with editing tpl chunks when all they want to do is highlight the current item on the list.

                Personally I think it would be terrific if both solutions could be implemented, it gives the user a quick and easy css class to modify the title link and gives a power user the tools they need to further customise the output.

                Having looked at the default tpl structure in the language file I think I’m following your idea a little bit closer and it would most likely be easier for you to implement.

                What you think?
                  • 33673
                  • 14 Posts
                  There is a bug when using language.

                  I use this:

                  [[Ditto? &startID=`31` &summarize=`2` &sortBy=`pub_date` &archiveDateType=`pub_date` &sortDir=`DESC` &trunc=`0` &tpl=`News` &language=`swedish`]]
                  


                  And it outputs the code on the page, but if I remove &language it outputs correctly.. oddly enough this works perfectly on another page. huh
                    • 4273
                    • 356 Posts
                    Has the ditto snippet been updated to include the use os index.php?q=

                    would be useful for those using ?q= or better yet work both ways for those using page.html too
                      SMF Bookmark Mod - check it out
                      http://mods.simplemachines.org/index.php?mod=350
                      • 7923
                      • 4,213 Posts
                      Quote from: bugsmi0 at Jun 12, 2006, 11:48 AM

                      Has the ditto snippet been updated to include the use os index.php?q=

                      would be useful for those using ?q= or better yet work both ways for those using page.html too
                      I’m sure that Ditto uses makeUrl function from MODx API to build links, so both/all url configurations are supported.


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."