Hi all, another brain teaser for you if you wouldn’t mind helping.
I am currently running a non-ajax mode search, the results return a pagetitle and an image (using the &tvphx parameter).
It looks great and works fine, but I would like to add a 2nd tv image to the results.
So my results would appear with a pagetitle, and 2 images underneath (one from each of my template variables). Is this possible? Any help appreciated
www.PawsForWildlife.co.uk
www.Borntobrick.co.uk
I have updated the results.tpl.html. And have changed my ajax call, but still only one tv image appears?
www.PawsForWildlife.co.uk
www.Borntobrick.co.uk
Could you post your AjaxSearch snippets calls and the results.tpl file.
Okay Snippet call - [!AjaxSearch? &asId=`as2` &ajaxSearch=`0` &showIntro=`0` &showResults=`0` &landingPage=`79` &advSearch=`allwords`!]
Landing page call - [!AjaxSearch? &asId=`as2` &ajaxSearch=`0` &parents=`80` &hideMenu=`0` &tvPhx=`Factfile, Factfile2` &whereSearch=`content` &order=`pagetitle` &extract=`2:longtitle,introtext`!]
And my results.tpl is...
<div>
<a href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
<div>
<img src="[+as.Factfile+]" height="[+as.Factfile2:imgmaxheight=`120`+]" />
<img src="[+as.Factfile2+]" height="[+as.Factfile:imgmaxheight=`120`+]" />
</div>
[+as.extractShow:is=`1`:then=`
<div><p>[+as.extract+]</p></div>
`+]
[+as.breadcrumbsShow:is=`1`:then=`
<span>[+as.breadcrumbs+]</span>
`+]
</div>
www.PawsForWildlife.co.uk
www.Borntobrick.co.uk
I posted the result.tpl (not results.tpl) and have amended the image height section to match the image source (switched the factfile and factfile2 placeholders)
www.PawsForWildlife.co.uk
www.Borntobrick.co.uk
I have cracked it! I kept &tvPhx=`tv_name,tv_name2` in my calls but I also added &withTV=`pagetitle`
Thanks all for the handy hints here and on other forum topics, its really helped alot!
www.PawsForWildlife.co.uk
www.Borntobrick.co.uk
Except if you have a TV named pagetitle, &withTV=`pagetitle` can’t have an effect.
Hi Coroico, thanks for the info. I have a slight problem. I am running two Ajax searches. The landing calls are
[!AjaxSearch? &hideMenu=`0` &ajaxSearch=`0` &parents=`71` &withTV=`pagetitle` &tvPhx=`Factfile, Factfile2` &order=`pagetitle` &rank=`pagetitle:100, introtext:10` &extract=`2:longtitle,introtext`!]
and
[!AjaxSearch? &asId=`as2` &hideMenu=`0` &ajaxSearch=`0` &parents=`81` &withTV=`pagetitle` &tvPhx=`Factfile,Factfile2` &order=`pagetitle` &rank=`pagetitle:100, introtext:10` &extract=`2:longtitle,introtext`!]
On the second call my results work and I get two images in the results. But on the first call I only get the first image (Factfile TV). The codes are identical other than the &asId=`2`, but I cannot use that in both codes. Any ideas where I am going wrong?
www.PawsForWildlife.co.uk
www.Borntobrick.co.uk
Okay, its been a pain but I have fixed it for both now. Where I added the ’&tvPhx’ parameter, I added my TV name and a comma and a space and my last tv name. For example
&tvPhx=`Factfile, Factfile2`
That extra space was stopping my second Tv from appearing, I have now amended it to:
&tvPhx=`Factfile,Factfile2`
www.PawsForWildlife.co.uk
www.Borntobrick.co.uk