We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    About tvPhx and the display of TVs. From this post :
    Neither do I. Also on the wangba demo site it doesn`t seem to work, there are no TVs rendered.
    The TV are rendered when the searchterms are found in the TV. Try for instance "2007-10" This term exists inside the asTag1. In this case the value is displayed as : 2007-10, Romania, 2007-10, Guatemala, ...

    Nevertheless, I recognize that this demo is not well explained and the drop down list not very accurate tongue

    To understand this result, takes as example the search with "education", which doesn’t provide any TV results:
    SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext, sc.template, sc.menutitle, sc.content, sc.publishedon, 
    GROUP_CONCAT( DISTINCT CAST(ntv.id AS CHAR) SEPARATOR "," ) AS tv_id, 
    GROUP_CONCAT( DISTINCT ntv.value SEPARATOR ", " ) AS tv_value 
    FROM `mod2_site_content` sc 
    LEFT JOIN( 
    SELECT DISTINCT tv.id, tv.value, tv.contentid 
    FROM `mod2_site_tmplvar_contentvalues` tv 
    WHERE (((tv.value LIKE '%education%'))) ) AS ntv ON sc.id = ntv.contentid 
    WHERE ((sc.id IN (63,316,64,65,66,67,68,69,70,71,72,310,73,97)) AND (sc.published=1) AND (sc.searchable=1) AND (sc.deleted=0) AND (sc.type='document') AND (sc.privateweb=0)) 
    GROUP BY sc.id 
    HAVING (((sc.pagetitle LIKE '%education%') OR (sc.longtitle LIKE '%education%') OR (sc.description LIKE '%education%') OR (sc.alias LIKE '%education%') OR (sc.introtext LIKE '%education%') OR (sc.menutitle LIKE '%education%') OR (sc.content LIKE '%education%') OR (tv_value LIKE '%education%'))) 
    ORDER BY sc.publishedon,sc.pagetitle

    The left join part:
    SELECT DISTINCT tv.id, tv.value, tv.contentid 
    FROM `mod2_site_tmplvar_contentvalues` tv 
    WHERE (((tv.value LIKE '%education%'))) 
    doesn’t provide any TV value if the searchterm doesn’t exist. In this test the value of the "tv_value" field of the records returned by the query is NULL.
    If you search "2007-10", as this term exists inside the TV asTag1 of 4 documents, you get as tv_value the concatenation of all the tv values of each document found. Here, document #64 with "2007-10", #66 with "2007-10,Romania", #70 with "2007-10,Guatemala", #90 with "2007-10"

    In conclusion, if the searchterm doesn’t exist in the TV, the TV value (concatenation of all the tv of a document) is not displayed.