We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7527
    • 437 Posts
    Hi all. I have recently added AdvSearch to my site. The search bar appears correct, and when I search it returns the results on a separate page. I have a TV named 'news_image' which is a large 600x100 image on each page. I want my results not just to return the pagetitle but also a smaller cropped version of the image TV (say 200x33). I managed to achieve a similar thing once before using phpThumbOf but I am struggling this time. My search form is simple:

    [[!AdvSearchForm? &landing=`22`]]


    The landing results page has:

    [[!AdvSearch?
    &addJQuery=`0`
    &perPage=`10`
    &withFields=`pagetitle,introtext,content,longtitle`
    &includeTVs=`news_image`
    &fields=`pagetitle,introtext,content,longtitle`
    &tpl=`AdvSearchResult`
    &offsetIndex=`res`
    &hideMenu=`0`
    &highlightTag=`strong`
    &highlightClass=`advsea-highlight`
    &highlightResult=`1`
    &showExtract=`1`
    ]]


    and the AdvSearchResult template has:

    <div class="advsea-result">
        <h3>[[+advsearch.idx]]. <a href="[[+advsearch.link:is=``:then=`[[~[[+advsearch.id]]]]`:else=`[[+advsearch.link]]`]]" title="[[+advsearch.longtitle]]">[[+advsearch.pagetitle]]</a></h3>
        <div>[[+advsearch.extracts]]</div>
    </div>
    


    I know I need to add something like this to the chunk:

    [[+news_image:phpthumbof=`w=200&h=100&zc=1`]]


    Any pointers would be appreciated please
    Regards,
    DS

    This question has been answered by distant_smile. See the first response.

      www.PawsForWildlife.co.uk
      www.Borntobrick.co.uk
      • 7527
      • 437 Posts
      In a similar getPage thing I tried I had this code

      <div class="newsblock">
      <div class="post-[[+id]] post hentry category-latest-news tag-tag3 tag-tag5 tag-tag7" id="post-[[+id]]"></div>
      <div class="entry">
      <h4><a href="[[~[[+id]]]]" rel="bookmark" title="Permanent Link to [[+pagetitle]]">[[+pagetitle]]</a></h4>
      <a href="[[~[[+id]]]]"><img class="alignleft" title="[[+tv.Factfile_title]]" src="[[+tv.Fact1:phpthumbof=`w=100&h=100&zc=1`]]" alt="" /></a>
      </div>
      </div><!-- end newsblock -->


      It is more or less what I am looking for but I don't know how to integrate it with the advSearch placeholders. If I use this code instead of the advSearch I get a link with an empty image box?
        www.PawsForWildlife.co.uk
        www.Borntobrick.co.uk
        • 11055 ☆ A M B ☆
        • 3,112 Posts
        try
        [[+advsearch.news_image:phpthumbof=`w=200&h=100&zc=1`]]
          Rico
          Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
          MODx is great, but knowing how to use it well makes it perfect!

          www.virtudraft.com

          Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

          Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

          Maintainter/contributor of Babel

          Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
          • 7527
          • 437 Posts
          Thanks. I have been trying to integrate that line into this:

          <div class="advsea-result">
              <h3>[[+advsearch.idx]]. <a href="[[+advsearch.link:is=``:then=`[[~[[+advsearch.id]]]]`:else=`[[+advsearch.link]]`]]" title="[[+advsearch.longtitle]]">[[+advsearch.pagetitle]]</a></h3>
              <div>[[+advsearch.extracts]]</div>
          </div>


          But not really sure how/where to place it? Any ideas please?
          Regards,
          DS
            www.PawsForWildlife.co.uk
            www.Borntobrick.co.uk
            • 11055 ☆ A M B ☆
            • 3,112 Posts
            [[!AdvSearch?
            &tpl=`myAdvSearchResultChunk`
            ]]
            


            myAdvSearchResultChunk
            <div class="advsea-result">
                <h3>
                    <a href="[[+advsearch.link:is=``:then=`[[~[[+advsearch.id]]]]`:else=`[[+advsearch.link]]`]]"
                       title="[[+advsearch.longtitle]]"
                       >
                        [[+advsearch.pagetitle]]
                    </a>
                </h3>
                <div>
                    <img src="[[+advsearch.news_image:phpthumbof=`w=200&h=100&zc=1`]]"
                         style="display: inline-block; margin: 0 5px 5px 0;"
                         >
                    [[+advsearch.extracts]]
                </div>
            </div>
            
              Rico
              Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
              MODx is great, but knowing how to use it well makes it perfect!

              www.virtudraft.com

              Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

              Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

              Maintainter/contributor of Babel

              Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
              • 7527
              • 437 Posts
              Thank you, I have tried the above and still no picture. My source code appears as the following:

              <div class="line number1 index0 alt2"><code class="php plain"><div class="advsea-paging1"></div>
              <div class="advsea-results-list">
                  <div class="advsea-result">
                  <h3>
                      <a href="beeflies.html"
                         title=""
                         >
                          Beeflies
                      </a>
                  </h3>
                  <div>
                      <img src=""
                           style="display: inline-block; margin: 0 5px 5px 0;"
                           >
                      
                  </div>
              </div>
              </div>
              <div class="advsea-paging1"></div></code></div></div>


              For some reason it is not out-putting the image source?
                www.PawsForWildlife.co.uk
                www.Borntobrick.co.uk
                • 7527
                • 437 Posts
                It is working now. When accessed from the homepage it works fine. But if I try a search from any other page it does not go to the landing page, instead it treats the page you are on as the landing page? The code is exactly the same across the pages so I don't understand it?

                www.pawsforwildlife.co.uk


                If anyone can tell me what is happening with all the other pages I would appreciate it!
                  www.PawsForWildlife.co.uk
                  www.Borntobrick.co.uk
                  • 11055 ☆ A M B ☆
                  • 3,112 Posts
                  check your AdvSearchForm's template
                    Rico
                    Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                    MODx is great, but knowing how to use it well makes it perfect!

                    www.virtudraft.com

                    Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                    Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                    Maintainter/contributor of Babel

                    Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                    • 7527
                    • 437 Posts
                    My search form is using the default tempalte:

                    <form id="[[+advsearch.asId]]_advsea-form" class="advsea-form" action="[[~[[+advsearch.landing]]]]" method="[[+advsearch.method]]">
                      <fieldset>
                        <input type="hidden" name="id" value="[[+advsearch.landing]]" />
                        <input type="hidden" name="asId" value="[[+advsearch.asId]]" />
                        [[+advsearch.helpLink]]<input type="text" id="[[+advsearch.asId]]_advsea-search" name="[[+advsearch.searchIndex]]" value="[[+advsearch.searchValue]]" />
                        [[+advsearch.liveSearch:isnot=`1`:then=`<input type="submit" id="[[+advsearch.asId]]_advsea-submit"  name="sub" value="[[%advsearch.search? &namespace=`advsearch` &topic=`default`]]" />`:else`=``]]
                      </fieldset>
                    </form>
                    [[+advsearch.resultsWindow]]


                    My call is a simple :

                    [[!AdvSearchForm? &landing=`22`]]


                    My landing page has the following call:

                    [[!AdvSearch? &perPage=`10` &addCss=`0` &addJQuery=`0` &parent=`0` &withFields=`pagetitle,introtext,content,longtitle` &includeTVs=`news_image` &fields=`pagetitle,introtext,content,longtitle` &tpl=`myAdvSearchResultChunk` &hideMenu=`2` &highlightTag=`strong` &highlightClass=`advsea-highlight` &highlightResult=`1` &showExtract=`1` &minChars=`3` ]]


                    the tpl `myAdvSearchResultChunk` is the same as was suggested on this thread:

                    <div class="advsea-result">
                        <h3>
                            <a href="[[+advsearch.link:is=``:then=`[[~[[+advsearch.id]]]]`:else=`[[+advsearch.link]]`]]"
                               title="[[+advsearch.longtitle]]"
                               >
                                [[+advsearch.pagetitle]]
                            </a>
                        </h3>
                        <div>
                            <img src="[[+advsearch.news_image:phpthumbof=`w=480&h=310&zc=1`]]"
                                 style="display: inline-block; margin: 0 5px 5px 0;" />
                            [[+advsearch.extracts]]
                        </div>
                    </div>


                    The search works, but the landing page shows an image (pulled from my news_image TV) at only 250x157 not 480x310 as specified in my tpl. Also, the search works from the homepage but if I try a search from any other page it just refreshes the page rather than going to the landing ID of 22? The call is the same on every page so I cannot understand why it works for the homepage?
                      www.PawsForWildlife.co.uk
                      www.Borntobrick.co.uk
                      • 11055 ☆ A M B ☆
                      • 3,112 Posts
                      You need to make sure your AdvSearchForms are using custom chunk, since built-in chunks will be overridden on package's updates.

                      Thus, check your search forms
                      [[!AdvSearchForm? &landing=`22` &tpl=`mySearchFormHome`]]

                      [[!AdvSearchForm? &landing=`22` &tpl=`mySearchFormSide`]]
                        Rico
                        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                        MODx is great, but knowing how to use it well makes it perfect!

                        www.virtudraft.com

                        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                        Maintainter/contributor of Babel

                        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.