Try our conversational search powered by Generative AI!

Resources from one site appearing on another (syssiteassets)

Vote:
 

Hi All,

We're running v11.4 in DXC and have a multi site setup. We have 'resource' blocks in a folder which is specifically for Site A and a page type which pulls a list of the resources from that folder. and it's the same setup for site B. The resource page should only pull resources for its own site. However in site B resource from both site A and B are showing up and the ones from site A are linking to www.siteA.com/SysSiteAssets....

Has anyone come across this before? I don't really know what the syssiteassets folder is and couldn't find much enlightening information before making this post.

Any ideas how to troubleshoot and fix?

thanks in advance,

Alex 

#195316
Jul 19, 2018 17:33
Vote:
 

Hello Alex

When you mention "pulls a list" I assume this is code. Can you post the code?

The syssiteassets folder is where all blocks that are marked as "For this site" live. I suspect the code that generates the list isn't filtering correctly for each site.

David

#195317
Edited, Jul 19, 2018 18:03
Vote:
 

Hi David,

thanks for your reply. The page controller code is as follows:

public class ResourcesPageController : PageController<ResourcesPage>
    {
        public ActionResult Index(ResourcesPage currentPage)
        {

            var results = new List<SearchResultViewModel>();

            var categories = new List<int>();

            try
            {
                results = ResourcesHelper.GetAll(categories);
            }
            catch (System.Exception)
            {

                throw;
            }

            var vm = new ResourcesPageViewModel(currentPage)
            {
                Categories = new List<CategoryViewModel>(),
                Resources = results

            };

            var cats = new List<CategoryViewModel>();

            foreach (var item in currentPage.TypesCategoryRoot ?? new CategoryList())
            {
                var cat = CategoryHelper.CreateCategoryViewModel(item);

                cats.Add(cat);
            }

            vm.Categories = cats.ToList();

            return View(vm);
        }


        [HttpPost]
        public JsonResult Search(SearchCriteria criteria)
        {

            var catList = criteria.Categories ?? new List<int>();

            var results = new List<SearchResultViewModel>();

            try
            {
                results = ResourcesHelper.Search(criteria.SearchTerm, catList, criteria.SortBy);
            }
            catch (System.Exception e)
            {

                throw new System.Exception(e.ToString());
            }



            return Json(results);

        }
    }

Presumably the key to the answer here is in that foreach loop where currentPage.TypesCategoryRoot isn't doing what I think it should be doing. Can you see anything?

thanks,

Alex

#195324
Jul 20, 2018 9:18
Vote:
 

Update to shut this thread down.

I can't speak of the correctness of the code we're running, but it works most of the time. However I did manage to remove the resources which were appearing in our second site through the CMS. 

In Admin > Tools > Manage Content, i located the hidden resources. after removing one of them the resources still appeared on site B, but instead of coming from sysassests they were now linking to the trash. So I looked at the trash, lots of things had appeared in there, cleared the trash and the resources were now gone.

result.

#195482
Jul 26, 2018 9:04
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.