We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24732 ☆ A M B ☆
    • 300 Posts
    trying to decipher this :

    set the TV value to an @SELECT binding
      ________

      Anne
      Toad-in-Chief
      Red Toad Media - Web Design, Louisville KY
      Hear me tweet: http://www.twitter.com/redtoadmedia
      "Bring on the imperialistic condiments." - Rory Gilmore
      • 24732 ☆ A M B ☆
      • 300 Posts
      from Susan Ottwell’s excellent site:

      The @SELECT binding returns the result set of a SELECT SQL query. Simply enter the query as a normal sql SELECT query. Placeholders can be used for variable values. Two placeholders are already set, [+DBASE+] and [+PREFIX+], which are set to your MODx database name and table prefix. Other placeholders can be set in snippets and @EVAL TVs. Just make sure the snippet or @EVAL TV is called before the @SELECT TV.

      This binding will return the raw result set of the SELECT query. You can process this either with your own snippet or configure the @SELECT TV to use the dataset output widget.

      Let’s say you have a listing of restaurants, and you want to display a list of restaurants in a given zip code. First you would set a placeholder with the zip code; how you get this is irrelevant to this discussion.
      $modx->setPlaceholder('restaurantzip', $zip);


      This code could be in a snippet processing a user-submitted form, or in an @EVAL TV.

      Then you would query your restaurant table (or whatever table you have the zip code of your restaurants in) using the placeholder you’ve set. Make sure to add the single-quotes around the placeholder if the value will be a string.
      @SELECT * FROM [+PREFIX+]restuarants WHERE zip='[+restaurantzip+]'


      This will give you a result set that you can process as you would normally process the result set of any SELECT query.

      Okay, off to examine the tables in MODx, not sure if I want to make a separate product table yet.
        ________

        Anne
        Toad-in-Chief
        Red Toad Media - Web Design, Louisville KY
        Hear me tweet: http://www.twitter.com/redtoadmedia
        "Bring on the imperialistic condiments." - Rory Gilmore
        • 24732 ☆ A M B ☆
        • 300 Posts
        All right, Ryan said to look at the ManagerManager tagging widget as a possible piece of my solution for multi-categories.

        You could also look a the ManagerManager tagging widget for the multi-categories thing which works quite nicely.

        So after deciding I’m not sure I want a separate product table yet, I decided to look at it. This meant I had to locate the ManagerManager docs, which, oddly enough aren’t in the wiki??? or not where I looked anyhow (are there THREE wikis?, two?? I’m so confused) and then I was struck with the brilliant thought that it might be in the package and it was... so I went to siteroot/assets/plugins/managermanager/docs/index.htm. Hallelujah

        But I found a great post on how to prep for ManagerManager while I was looking for info on the widget, so all is not lost.

        The docs say:

        mm_widget_tags(($fields, $delimiter, $source, $display_count, $roles, $templates)


        Changes the manager widget for this text field to tag-friendly format - e.g. it will display a clickable list of all other tags which have been used for this field.

        $fields: The name(s) of the template variables this should apply to. Can accept multiple field separated by a comma. [Required]

        $delimiter: Which character separates individual tags within this field [Optional - default is comma)

        $source: The names(s) of the template variables the list of tags should come from. This allows the list of tags to come from a different field that the widget. By default it uses all the TVs listed in $fields [Optional - default is same as $fields] 

        $display_count: Display the number of documents using each tag (in brackets after it) [Optional - boolean - default is false] 

        $roles: comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]

        $templates: comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]


        mm_widget_tags(’docTags’); // Adds the tag editing widget to the docTags template variable wherever it appearsmm_widget_tags(’docTags,blogTags’); // Adds the tag editing widget to the docTags and blogTags template variables wherever they appear - making all previous values from both template variables available in both tagsmm_widget_tags(’docTags’, ’,’, ’’, ’1’, ’’, ’2’); // Adds the tag editing widget to the docTags template variables in template 2, and shows the number of times each tag has been used

        Note: TV(s) must be a text input field

        And I have no idea what that means. None. Looking now for an example of usage because what I think this means is if I apply this rule to an input field it will show me other tags used on this field. How do I use that to make categories? what am I missing?

        going to go ahead and start on this now, making my categories -tags- and then come back to this. Still not sure if I should throw all products into one container. Am thinking yes.


          ________

          Anne
          Toad-in-Chief
          Red Toad Media - Web Design, Louisville KY
          Hear me tweet: http://www.twitter.com/redtoadmedia
          "Bring on the imperialistic condiments." - Rory Gilmore
          • 24732 ☆ A M B ☆
          • 300 Posts
          okay, have read over the info graciously provided by pogwatch here:
          http://www.pogwatch.com/ditto/ditto-extenders/ditto-tagging.html

          and think I can make the categories with tags.

          I’m going to go ahead and move forward with FoxyCart integration.
            ________

            Anne
            Toad-in-Chief
            Red Toad Media - Web Design, Louisville KY
            Hear me tweet: http://www.twitter.com/redtoadmedia
            "Bring on the imperialistic condiments." - Rory Gilmore
            • 5340
            • 1,624 Posts
            Quote from: redtoad at Mar 04, 2010, 01:47 PM

            I’m going to go ahead and move forward with FoxyCart integration.

            I’d love to hear about your foxy cart integration.
            Thx for the diary
              • 29635
              • 361 Posts
              Quote from: redtoad at Mar 04, 2010, 10:03 AM

              Okay, off to examine the tables in MODx, not sure if I want to make a separate product table yet.
              I wouldn’t bother (at all) with creating a new table. Just use MODx documents with TVs for your products. WAY easier. The only reason to create a separate table would be if you had a massive number of products.

              I meant use a @SELECT binding to allow the TV selections (checkboxes) to be populated from MODx documents (so, create a document called "Categories", then make children "Electric" "Acoustic" "Used" "Vintage" etc.). Doesn’t really make a difference though, and if you’re using MM’s tagging widget that’d be the best idea.
                Need MODx Ecommerce? Try FoxyCart!
                • 24732 ☆ A M B ☆
                • 300 Posts
                @cipa, you’re welcome

                @Brett...All right, I’m going to try that. Thank you!!

                Have been working on templates.

                Had to do some jquery foo to get my images properly situated, still have one more tweak to add to that... making the feature image appear in a lightbox when you click on it, huge. But my head is going to explode if I have to mess with jquery anymore so I’m going to let DoubleToadSeven, my programmer, fix that and move on.

                Current effect courtesy of http://benmacgowan.co.uk/2009/07/20/image-replacement-gallery/

                you can see it here:

                http://smokymtguitars.com/build/index.php?id=16

                I’ve set up the cart pieces mostly, still have to finesse a bit, but my buttons work. I made TVs for the feature image, thumbnails, sale price, purchase price, description...you save will be js. Set the Foxy cart code in my template header. I format forms in tables. Yes I know I can do it in CSS, but I’m not. This is it without the image tvs laid in, because I’m still working on that jquery piece. But you’ll get the idea.

                <form class="foxycart" action="https://smokymtguitars.foxycart.com/cart" method="post" accept-charset="utf-8">
                
                <table width="100%" border="0">
                <tr class="gallery">
                     <td class="feature"><p><a href="#" >
                        <img src="assets/images/sampleproductdetail.jpg" alt="Starter" ></a></p></td>
                     <td>
                        <p class="thumbnails"><a href="assets/images/313s.jpg" ><img src="assets/images/more-thumbs.jpg" alt="number one" width="100" height="128"></a></a></p>
                        <p class="thumbnails"><a href="assets/images/sampleproductdetail.jpg"><img src="assets/images/more-thumbs.jpg" alt="Two" width="100" height="128"></a></p>
                        <p class="thumbnails"><a href="assets/images/sampleproductdetail.jpg"><img src="assets/images/more-thumbs.jpg" alt="Three" width="100" height="128"></a></p>
                          </td></tr>
                   <tr>
                      <td width="71%" height="333"><p class="detailscopy">[*content*] </p></td>
                      <td width="29%"><p class="email"><a href="#">Email this to a Friend! </a></p>
                        <p class="price">Price: [*listPrice*] </p>
                        <p class="sale">Sale Price: [*salePrice*] </p>
                        <p class="yousave">You Save: <br>
                        <input type="hidden" name="name" value="[*prodName*]" />
                        <input type="hidden" name="price" value="[*salePrice*]" />
                          <br>
                       <input name="add_to_cart" type="image" src="assets/images/addtocart.gif" alt="Add to Cart " class="submit" align="top">
                
                   </tr>
                  </table>
                </form>


                Right now I have to go make the Ditto template chunks and set up the contianer as advised by "TheMan."

                Question, if I set it up tha way ...like tags? how do I put that into the wayfinder?

                hrm. I guess it will still go to a resource id, I have the category container and then the separate pages per specific tag...wayfinder will find them, got it.

                tired.


                  ________

                  Anne
                  Toad-in-Chief
                  Red Toad Media - Web Design, Louisville KY
                  Hear me tweet: http://www.twitter.com/redtoadmedia
                  "Bring on the imperialistic condiments." - Rory Gilmore
                  • 24732 ☆ A M B ☆
                  • 300 Posts
                  I meant use a @SELECT binding to allow the TV selections (checkboxes) to be populated from MODx document

                  this sounds almost mystical.

                  if I get everything else put in I might try it.
                    ________

                    Anne
                    Toad-in-Chief
                    Red Toad Media - Web Design, Louisville KY
                    Hear me tweet: http://www.twitter.com/redtoadmedia
                    "Bring on the imperialistic condiments." - Rory Gilmore
                    • 24732 ☆ A M B ☆
                    • 300 Posts
                    hm. If I make the categories tags then making -new- categories becomes -my job-

                    hm.
                      ________

                      Anne
                      Toad-in-Chief
                      Red Toad Media - Web Design, Louisville KY
                      Hear me tweet: http://www.twitter.com/redtoadmedia
                      "Bring on the imperialistic condiments." - Rory Gilmore
                      • 24732 ☆ A M B ☆
                      • 300 Posts
                      dipping my toe in tagging waters, am not sold yet.

                      I made a TV called "docTags" it is a text box, and added the rule

                      mm_widget_tags('docTags');


                      to my mm_demo_rules chunk.

                      now then I go to my sample item’s page in the doc tree and enter: Beard, New Arrival, Resonator Guitar

                      and save.

                      going back to it, there is now a list under the "docTag" TV input box in the item’s page. Screen shot attached. I really like the idea of checkboxes, but this might work. How do I get the similarly-tagged-items to aggregate? Ditto? um. yeah. What if I put a Tv inside the ditto call, can I do that? then I could let them add categories to their little hearts content. might be too much tho. KISS. one step at a time. Going to make a sample ditto category page.

                        ________

                        Anne
                        Toad-in-Chief
                        Red Toad Media - Web Design, Louisville KY
                        Hear me tweet: http://www.twitter.com/redtoadmedia
                        "Bring on the imperialistic condiments." - Rory Gilmore