1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Get pages by tag

Get pages by tag

2 posts, 0 answered
  1. Matt
    Matt avatar
    14 posts
    Registered:
    25 Jan 2012
    10 May 2012
    Link to this post
    Hello,

    I'm currently migrating a site from 3.2 to 5 and am having to update a few pages/controls where the API has changed. Overall it's going pretty well, but one of the functions on the site is a "tag results page", which is a paged list of all pages containing content which contains the tag the user selected (i.e, if you pick "outdoors" from the tag list you will be taken to a page that is a list of all pages containing content that was tagged "outdoors").

    Is there a good way using the SF 5 API to get all pages containing content that has a specific tag? Currently in the 3.2 site, it looks like this:

    CmsManager cmsManager = new CmsManager();
    List<string> controls = new List<string>();
    foreach (TaggedContent content in tag.TaggedContent)
    {
        controls.Add("'" + content.ContentID.ToString() + "'");
    }

    Then, the list of guids is fed into the following stored procedure:

    SELECT     DISTINCT sf_CmsCtrlLinks.PageID
    FROM         sf_CmsControlProperty
    INNER JOIN sf_CmsCtrlLinks ON sf_CmsControlProperty.ControlID = sf_CmsCtrlLinks.ControlID
    WHERE     (sf_CmsControlProperty.Name = 'Content') AND (sf_CmsControlProperty.Value IN <LIST_OF_GUIDS_FROM_ABOVE_CODE_BLOCK>)

    I've looked through the Taxonomy API and have searched the forums extensively, but haven't found anything yet. Any help would be awesome!

    Thanks,

    matt
  2. Matt
    Matt avatar
    14 posts
    Registered:
    25 Jan 2012
    15 May 2012
    Link to this post
    Unfortunately it seems that in SF 4.x/5.x this kind of thing is no longer possible.
2 posts, 0 answered