We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6470
    • 69 Posts
    I know how to have different content on pages by using TVs

    But how to have variable snippets calls depending on pages

    I tryed to insert snippet in a TV
    but it does not parse but display the tvs content

    What should I do

    What actually I am trying to do is.

    with out breaking the template . insert eform call snippet only in page contacts
      • 11975
      • 2,542 Posts
      Hi,

      Install the PHx plugin and then insert in your template something like

      [*id:is=`you_id_contact`:then=`[[eForm? &param=``]]`*]


      hope that helps.

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 6470
        • 69 Posts
        that a good idea.

        Would you extend your help by suggesting

        How to make this

        1 I whant to have a simple PHx snippet call in the template
        2 I whant to keep main call in a chunk
        3 I whant to have conditions for every page via TVs via web interface

        if page 3 call this snippet
        if page 4 call that snippet
        if page 5 call nothing
        if page 6 ....


        4
          • 33372
          • 1,611 Posts
          Er... All you want to do is to put a snippet on certain pages? Why can’t you just put the snippets you want in those pages’ document content?

          Or I guess you can add the same snippet to all of them and then use the document’s id within the snippet ($id = $modx->documentIdentifier;) to determine its output.

          I’m really not sure what you want to do, but it sounds as if you’re trying to do it the hard way...
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn't very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 6470
            • 69 Posts
            yes you are right. That is. i got to do.

            But I tried to put a snippet in a TVs and it renders as plain text in pages.

            Need help. how practically put a snippets in certain pages only?

            I got very simple template
            left column, main column
            5 documents( main, contacts, etc)
            and tvs for left and main content which is edited via front end rich text editor.
            So how to insert snippets and force them to execute(start).(otherwise it renders as palin text)

            //Or I guess you can add the same snippet to all of them and then use the document’s id within the snippet ($id = $modx->documentIdentifier;) to determine its output.//
            this idea is good for me also, but I have no idea how to implement it.
            i mean where should i insert a snippet call. if $id=$modx->documentidentifier=page 3
            call[[snippet]] huh?