Article Tagging

8 posts by 2 authors in: Forums > CMS Builder
Last Post: December 22, 2008   (RSS)

Re: [s2smedia] Article Tagging

By Dave - December 17, 2008

Hi s2smedia,

Ok, so you want to only show certain records on certain pages? Is that right?

There's two ways you can do this. You can use the built in search engine features here: http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

And add values to the url to filter results like this:
http://apexfinal.highviews.co.cc/summer_index.php?academy=Futsal+Academy

Or you can hard code it in the viewer code by adding a where option:
'where' => " academy = 'Futsal Academy' ",

Let me know if one of those will work for you.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Article Tagging

By s2smedia - December 17, 2008

Dave,

You are the best!!!! Works like a charm!!!

Re: [Dave] Article Tagging

By s2smedia - December 18, 2008

one last question regarding this..

now how can i code the viewer code to now display articles tagged as Futsal Academy & the location they choose

ex.

'where' => " academy = 'Futsal Academy' ", "futsal_location = "<?php echo $summer_academy_locationsRecord['location'] ?>",

will that work?

the locations pages are set as detail pages. so I would need the location pulled in depending what location they choose.

example:

goto http://apexfinal.highviews.co.cc/summer_index.php

then select a location from the featured location box...
the location detail page (http://apexfinal.highviews.co.cc/summerlocation_details.php) "news" section should now not only show summer academy news but now should filter to news from the location / summer academy...

let me know if you have any questions...thanks!!

Re: [s2smedia] Article Tagging

By Dave - December 18, 2008

Hi s2smedia,

I'm not sure if I understand exactly, but you can try this. You can mix both types of search methods. So if you have a viewer with " academy = 'Futsal Academy' " coded as the where you can link to it like this:

viewer.php?futsal_location=<?php echo $summer_academy_locationsRecord['location'] ?>

And it will filter on both. Let me know if that works for you. In not can you attach your viewer php file so I can see the code?

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Article Tagging

By s2smedia - December 19, 2008

ok let me try to explain again.

I have a section in my cms for news..
i have it so you can select what academy and location the news story relates to.
(you can see in the image i originally attached)

for example.

News Story 1 (tagged: Summer Academy, Summer Academy Location 1)

so now this article will be visible on the Summer Academy Home Page and it should also be visible on the Summer Academy Location 1 page

i used this code in my viewer for the Summer Academy Home Page and it works fine because the academy is hard coded in, the academies do not change:
'where' => " academy = 'Summer Academy' ",

but for Summer Academy Location 1 page i cant hard code the location because the locations change. so i need the viewer code to be something like this:
'where' =>"summer_location='<?php echo $summer_academy_locationsRecord['location'] ?>'"

<?php echo $summer_academy_locationsRecord['location'] ?> this would make it so whatever location they select, be the news articles that are listed

So example:

http://apexfinal.highviews.co.cc/ <- all news articles will be listed
http://apexfinal.highviews.co.cc/summer_index.php <- only news articles tagged for summer academy will be listed

if you click on one of the featured locations on the (http://apexfinal.highviews.co.cc/summer_index.php) page it will bring you to
http://apexfinal.highviews.co.cc/summerlocation_details.php?Las-Vegas-NV-3
<- on that page i would need only news articles tagged with Summer Academy Location Las Vegas, NV

Re: [s2smedia] Article Tagging

By Dave - December 22, 2008

Hi s2smedia,

>so i need the viewer code to be something like this:
>'where' =>"summer_location='<?php echo $summer_academy_locationsRecord['location'] ?>'"

Is $summer_academy_locationsRecord already set or is it being generated by the same getRecords() call? In any case, here's how to do that:

'where' => "summer_location='" .mysql_real_escape_string($summer_academy_locationsRecord['location']). "'",

Hope that helps! Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Article Tagging

By s2smedia - December 22, 2008

PERFECTO!!

Thanks again