Adding TAGS to a template search

derrickhand300
@derrickhand300
10 years ago
1,353 posts
I am trying to get lists from the database for combined videos

An example of what I am trying to tell the database would be something like this

" Get me all the videos that are listed under the category "Football" that have the tags "5th" and "6th"

This list would include videos from both jrVideo AND YouTube video modules
This from my datastore browser for "Youtube"
youtube_category: Football
youtube_tags: ,football,5th,6th

This is the code from the datastore for jrVideo
video_category: Basketball
video_tags: ,5th,6th,


Can you tell me my mistake-I am thinking it will be obvious to someone that knows this :0

{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc"  search1="youtube_category = football" search1="*_tags LIKE %5th%" search1="*_tags LIKE %6th%" search2="video_category =football"  search2="*_tags LIKE %5th%" search2="*_tags LIKE %6th%" 
pagebreak=15 page=$_post.p pager=false template=$tpl}

NOTE it seems to be working EXCEPT it keeps pulling in a Youtube video that has the category 'basketball"
From the datastore for the particular video:
youtube_category: basketball
Why is the above template code fetching a youtube video with the category of basketball?

I have ran the integrity check several times and I have ran repair.php also thinking it might be something stuck in the database...still the basketball video is there- you can see its the first video on this test page

http://sayreeagles.net/test/

updated by @derrickhand300: 03/10/16 01:59:34AM
brian
@brian
10 years ago
10,149 posts
The problem here is that you have THREE "search1" parameters, so the next is overwriting the previous - try this:

{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_item_id desc"  search1="youtube_category = football" search2="*_tags like %5th% || *_tags like %6th%" pagebreak=15 page=$_post.p pager=false template=$tpl}

Note how I use an OR condition in the search2 parameter, and each search parameter is incremented by one (i.e. search1, search2, search3 and so on). I also changed the order_by from _created to _item_id - ordering by _item_id is the same as _created but faster.

Let me know if that works.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thank you Brian- if I use the above code which has
search1="youtube_category = football"
How will the code know to ALSO search for jrVideos with the category 'football"?
I just ask because I am not seeing any reference to the jrVideos in the search and I am after BOTH youtube and jrVideos

Also i have added the code here and it returns NO results?
http://sayreeagles.net/test/
updated by @derrickhand300: 11/22/15 01:34:41PM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Trying to answer my own question...

{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_item_id desc"  search1="youtube_category = football" search2="*_tags like %5th% || *_tags like %6th%" search3="youtube_category = football" search4="*_tags like %5th% || *_tags like %6th%" pagebreak=15 page=$_post.p pager=false template=$tpl}

This "should" get the videos from both modules?
paul
@paul
10 years ago
4,335 posts
Try this -
{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_item_id desc"  search1="*_category = football" search2="*_tags like %5th% || *_tags like %6th%" pagebreak=15 page=$_post.p pager=false template=$tpl}



--
Paul Asher - JR Developer and System Import Specialist
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Hold on....the issue may be the tag...i changed them all in the batch edit for youtube to 5th,6th,football....but when I view the actual video that is not the tag on the item detail page....let me try to correct this...then maybe the above will work
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thanks Paul...so the "*" says "get all the modules requested with seamless"? starting to understand it some now
paul
@paul
10 years ago
4,335 posts
derrickhand300:
Thanks Paul...so the "*" says "get all the modules requested with seamless"? starting to understand it some now

Yeah - its a 'wildcard'. It'll search for both "video_category = football" and "youtube_category = football".


--
Paul Asher - JR Developer and System Import Specialist
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Cant figure out where I am going wrong

I have 3 test versions on the page right now

1
{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc"  search1="youtube_category = football" search2="*_tags like %5th%" || "*_tags like %6th%" pagebreak=15 page=$_post.p pager=false template=$tpl}

2
{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc"  search1="youtube_category = football" search2="*_tags like %5th% || *_tags like %6th%" pagebreak=15 page=$_post.p pager=false template=$tpl}

3
{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc"  search1="*_category = football" search2="*_tags LIKE %5th%" pagebreak=15 page=$_post.p pager=false template=$tpl}

Test version 3 is the only code that will return any videos

When I add the || to the tags- then I do not get ANY videos back
updated by @derrickhand300: 11/22/15 03:37:49PM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
The tags for '5th" are showing up BUT NOT the tags for "6th"?
douglas
@douglas
10 years ago
2,806 posts
Give this a try:

{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc"  search1="*_category = football" search2="*_tags LIKE %5th%" search3="*_tags LIKE %6th%" pagebreak=15 page=$_post.p pager=false template=$tpl}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thank you Douglas-but it still wont pull the tags for 6th- I dont know what could be wrong...I have added a tag to a few videos called "6th" that have the category of "football" selected when they were uploaded/updated....but they still do not show up
douglas
@douglas
10 years ago
2,806 posts
Did you reset your cache?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Yes I reset caches...I apologize but it still will not pick up the second set of tags
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Having the same issue with images...

<h1>Elementary School Basketball Fan Photos</h1>
<div id="vidwrap">
<div style="margin: 5px">
<a title="Upload A Photo From Your Device" href="http://sayreeagles.net/gallery/create" target="_blank"><img style="float: left; margin: 10px;" src="http://sayreeagles.net/upimg/image/upimg_file/75/128" alt="Upload A Video From Your Device" border="0"></a>
{jrCore_list module="jrGallery" search1="gallery_title = basketball"  search2="tags LIKE %5th%" search3="tags LIKE %6th%" order_by="_created desc" limit="36" template="widget_list_grid_6.tpl" tpl_dir="jrGallery"}
</div>
</div>
not returning any images but if you go to the datastore you can see the images with the gallery title of basketball and tags of 5th or 6th

Is there some way to force jamroom to reindex all this stuff in the database?
I have tried integrity checks and repair.php several times but no luck- driving me crazy
I keep wondering if its because I am using site builder instead of writig the entire page myself?
Thanks

*The reason I ask about reindexing is because over the last 2 weeks I have had to make several changes to the form designer fields of videos and images...even though those changes are showing up in the datastore I dont think they are being picked up when the template code attempts to parse the data...( something like that)
updated by @derrickhand300: 11/24/15 12:19:59PM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
I have tried all of the above code and can ONLY get the search2 tag back...but never the search3tag...
Is there some way to add
{$item.youtube_tags}
to the template to tell it to return all the tags?
Im using the datastore and smarty debug now trying to figure it out-see screenshot

Maybe if I explain what I am trying to do it will shed some light on what I am doing wrong

I have a page called "BASKETBALL" -on this page there is a display of all videos uploaded with the gallery title 'BASKETBALL'

Also on the page are 3 links to separate pages
HIGH SCHOOL BASKETBALL
MIDDLE SCHOOL BASKETBALL
ELEMENTARY BASKETBALL

Each video under the gallery title BASKETBALL has tags
tags for ELEMENTARY BASKETBALL are 5th, 6th,
tags for MIDDLE SCHOOL BASKETBALL are 7th, 8th
tags for HIGH SCHOOL BASKETBALL are 'high school"

So when you go to the ELEMENTARY BASKETBALL page I want the video display to display all videos with the gallery title of basketball AND the tags 5th, 6th

When you go to the MIDDLE SCHOOL BASKETBALL PAGE I want the video display to display all videos with the gallery title BASKETBALL AND the tgas 7th, 8th,

I have tried all of the above code to make that happen but no matter which of the above codes i use...I only get videos from BASKETBALL and ONLY the first search for tag...search2 tag is not showing up...

maybe it can be written like this?
{jrCore_list module="jrGallery" search1="gallery_title = basketball"  $item.youtube_tags  order_by="_created desc" limit="36" template="widget_list_grid_6.tpl" tpl_dir="jrGallery"}
I feel like it HAS to be a problem with the way I am coding it..

Anyone see any obvious way i am missing this?
Thanks again
Capture.jpg
Capture.jpg  •  114KB


updated by @derrickhand300: 11/24/15 04:12:04PM
douglas
@douglas
10 years ago
2,806 posts
I'm not sure why the search3 isn't working, may be give this a try.

{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc"  search1="*_category = football" search2="*_tags LIKE %5th% OR *_tags LIKE %6th%" pagebreak=15 page=$_post.p pager=false template=$tpl}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thanks Douglas- but this is not working either...its some sort of bug nobody has looked into yet... none of the combined item lists are working correctly..

That code is installed here now ( all of the above 4 codes are installed here) If i make a list just using 'category" and omit the tags...then it displays the videos for the category fine- problem seems to happen when adding tags...Last night I uninstalled/reinstalled
SEAMLESS
COMBINED AUDIO
COMBINED VIDEO
ITEM TAGS
but it did not help

http://sayreeagles.net/test/
as you can see it displays NOTHING :(

Ive spent a few DAYS on it and each of you Talldude guys have all given me the correct codes-but NONE of them work

Got to be an issue with the new core/updates/bugs
updated by @derrickhand300: 11/25/15 11:21:15AM
michael
@michael
10 years ago
7,816 posts
This works: "Get all the football Video and Youtube that have tags '5th'"
{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc" search1="*_category = football"  search2="*_tags LIKE %5th%" pagebreak=15 page=$_post.p pager=false}

This works: "Get all the football Video and Youtube that have tags '7th'"
{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc" search1="*_category = football"  search2="*_tags LIKE %7th%" pagebreak=15 page=$_post.p pager=false}

This doesn't: "Get all the football Video and Youtube that have tags '5th' or '7th'"
{jrSeamless_list modules="jrVideo,jrYouTube" order_by="_created numerical_desc" search1="*_category = football"  search2="*_tags LIKE %5th% || *_tags LIKE %7th%" pagebreak=15 page=$_post.p pager=false}

But it should, I'll get setup to check it out. Thanks.
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thanks Michael...Thats correct
adding the second tag in the code is screwing it up-thanks for looking at it.
Got some homemade aged brandy here for ya when you get out this way:) ( and some Moonshine...because its Thanksgiving here)

Just an FYI on one of my other sites im seeing an issue creating lists using the site builder-each time I use the editor to edit the template code it adds an extra set of "%%" to the tag word
for instance if I added the word %photo%...if I made changes and adjustments to the code in the editor and saved it would come lout like %%%%%%photo%%%%%% depending on how many times I saved it ( 6 saves in the above example)
updated by @derrickhand300: 11/26/15 02:01:49PM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
any news on this one?
Thanks!
douglas
@douglas
10 years ago
2,806 posts
Yes, this should be fixed for the next release.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thank you

Tags