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

    I’m trying to convert some of the text I get from Ditto into an image using a specified font. Or actually, I haven’t tried yet, because all I have is a couples lines of code I wrote that work when you manually supply a string to be converted. I’m a little confused on how I’m supposed to implement this as a snippet.

    Would something like this be a good way (using a wrapper snippet)?

    http://modxdeveloper.com/blog/the-wrapper-snippet-run-a-snippet-from-within-another-snippet

      • 7231
      • 4,205 Posts
      maybe put your code in a snippet and embed that snippet in the Ditto tpl chunk. For example in the chunk you may have:

      <h1>[+pagetitle+]</h1>


      and lets say you want the title to be modified:

      <h1>[!yourSnippet? &input=`[+pagetitle+]`!]</h1>

      Where yourSnippet is the snippet you created to make the pic. You can also use PHx and build a custom modifier for this.

      Now, haveing said all that, I would probably look into an alternative like cufón or sIFR to generate the rich font.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 11114
        • 3 Posts
        I tried putting the snippet into a chunk, but it wasn’t working. All I got was [!snippet!] actually printed out on the page.

        But I’ve figured it out. I’ll just use Ditto’s output to put in the image/script URL, since the script uses GET. BTW the script I made does the job, but this one’s nicer. So if anyone needs it...

        http://www.alistapart.com/d/dynatext/heading.txt
          • 7231
          • 4,205 Posts
          Glad you got it working. Good example of thinking around the problem wink
          All I got was [!snippet!] actually printed out on the page.
          When embedding snippet calls they need to alternate so that the outer snippet call is cached [[ ]] and the inner one uncached [! !]. So when you get output you got, the first thing to check is the alternating sequence of the snippet calls in correct.
          [[snipet1? &param=`[!snippet2? &param2=`xx`!]`]]

            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 11114
            • 3 Posts
            I figured it was something like that. I don’t need it for this now obviously, but it’s good to know smiley. Thanks a lot, I appreciate the help.
              • 3866 ☆ A M B ☆
              • 350 Posts
              Hi laugh,
              Thx again PK!!!.

              At last I have a little ditto problem. Ok I’m not at the right place here on the forum, but I didn’t find a good link yet.

              I made the needed TV’s. Used the needed widgets. I put the needed [+myTV+]’s placeholders into a chunk like all the other TV’s and put the name of the chunk in the ditto snippet like so: &tpl=`myChunk`.
              I used the &language=`nederlands` caus I’m Dutch speaking.

              It doesn’t work and the weird thing is if I erase both the chunk and the form in the heredoc TPL he don’t give an error.
              Ok I thought, maby if he doesn’t find anything, probably he use the standard english.inc.php file. So I did a test, erased the form in the heredoc TPL; as well.
              And shocked you never guess. When I reload the newsblog page, he shows everything as if nothing ever happend, but without the extra TV’s

              So I restarted my windows, maybe there was a system catch problem, but that’s not helping. I made some extra newsblog items in mind that new changes only work on new items. Doesn’t work either.

              I looked at the forum pages, the ditto site and so on, nothing to find.

              Does somebody have a good link where I can find more issues on this matter?
              Or does somebody ever had the same problem.

              Thx in advance
              Benny

                Helen Warner
                Number one pixel!
                Proud to be linked with MODX at Crimson Pixel