0

I'm working with news items. On a home page, I need to display a list of news items that link to news pages.

My content tree looks like

  • Home Page
  • News

    • News 1 Page
  • Shared Content

    • News
      • News 1 Content

With News 1 Page using News 1 Content as its Datasource etc.

That's all fine but on my home page, I also have a news listing control which has Shared Content/News as its data source. That displays correctly but I then need to link to the actual page in News and I don't have that link in the Datasource and don't know what the URL is. I want to link from the news snippet on the home page to the news page related to that news content. I'm using View Renderings.

So firstly does that tree look good to you? And secondly, how can I get a link to a news page from that news listing on the home page?

2

From what I understand, your content tree looks something like this:

Sitecore
|_Content
  |_Home
  | |_News
  |   |_News1 Page
  |_SharedContent
   |_News
     |_News1 Content

This can be a viable way to organise things, but I would only go this route if you really need to and get some real benefit from doing so i.e. if you have a multi-site solution and need to share those articles between the sites (in that case, you would still have some SEO considerations regarding duplicate content which would need to be addressed).

You need to ask yourself: What is the actual benefit of splitting the news article content between the news pages and the news SharedContent items?

Under this architecture, you have two basic options:

  1. Store a link to the pages within the SharedContent items. You could maybe auto-populate / auto-update this link from a save action of a specific template type, however you still have to contend with the scenario of having multiple pages linking to the same SharedContent item

  2. Perform some kind of query to determine the page items which link to your SharedContent items - this will be SLOW!

My opinion is that neither of the above options are particularly nice and that you should try to keep things simple and structure your content as follows:

Sitecore
|_Content
  |_Home
    |_News
      |_News1 Page
| improve this answer | |
0

Tree looks good to me. If i was you i would keep Shared content on the same level of Home and News as sub level to Home

  • SharedContent
  • Home
    • News

From home page on news listing control instead of pointing datasource to shared content/News why don't you try pointing to News? In such case you can know the news url's and even datasources(News 1 Content) associated with them.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.