Article Tagging

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

Ok, you guys have helped me with every question i've had so far... lets see if you can help with this.

So i have a website that contains 3 different sections.

Main Section
Main Sub Section
Sub Section

I have a News listing manager that when the user will post a News Article I would like the to select what section/sub section this news article should apply to. Similar to tagging the news article.

The Main Section will display all news articles (I have this working fine)
The Main Sub Section would display the news articles based on the Academy they tag the news article with.
The Sub Section would display the news article based on the Location they tag the news article with.

I attached an image with how i have the listing manager set up with the tags.

heres is the test link for the website:

Main Page Section:
apexfinal.highviews.co.cc

Main Sub Page Sections:
apexfinal.highviews.co.cc/futsal_index.php
apexfinal.highviews.co.cc/summer_index.php
apexfinal.highviews.co.cc/goalkeeper_index.php

Sub Section Page: (this page is under construction but will be set up similiar to the Main Sub Pages, except will have the location details, as well as the news that was tagged for this location.
apexfinal.highviews.co.cc/summerlocation_details.php?Philadelphia-PA-2

Let me know if you have any questions!!

Thanks in advance
Attachments:

picture-1_003.png 197K

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

Dave,

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

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

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

PERFECTO!!

Thanks again