We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48842
    • 37 Posts
    SimpleSearchForm outputs like:

    <fieldset>
    <label for="search">Search</label>

    etc.

    Because of styling considerations, I would like it to output like:

    <fieldset class="foo">

    How would I go about doing this?

    Thanks in advance! [ed. note: fbachofner last edited this post 7 years, 7 months ago.]
      • 32507
      • 142 Posts
        • 48842
        • 37 Posts
        Hi Mika:

        Quote from: wintertribe at Aug 30, 2016, 10:52 AM
        You can do custom chunk and call it with &tpl property.

        Thank you so much! This was incredibly simple.

        Some details for those new to MODX:

        1. Create a chunk called something like "SimpleSearch_Fieldset"
        2. Copy and then modify the "Default Value" of the SimpleSearch.SimpleSearchForm.tpl as provided at https://rtfm.modx.com/extras/revo/simplesearch/simplesearch.simplesearchform/simplesearch.simplesearchform.tpl
        3. Place the SimpleSearch form on the page like so:
          "[[!SimpleSearchForm? &tpl=`SimpleSearch_Fieldset` &landing=`8`]]"
          -- this will replace the default tpl with the edited tpl (from the [[$SimpleSearch_Fieldset]] chunk.
        4. the only "surprise" is that the chunk is not called with the regular $ prefix, and of course without the brackets
          • 32507
          • 142 Posts
          the only "surprise" is that the chunk is not called with the regular $ prefix, and of course without the brackets

          That because this is Snippet call and $tpl is snippet parameter referencing the chunk. Chunk is called in the snippet itself. It's like this with other extras too.

          If you call chunk (for example in content field), the format is [[$chunk]]