11

I have a unusual requirement, I need to have a Structure Group with 2 pages. One called index.html and one called index.jsp.

I thought easy!

  • Set the name of each to the full file name i.e. index.html & index.jsp
  • Then, set the filename of both pages to index and the Page Template would handle the different extension

But, I unexpectedly (in my opinion) get:

System.ServiceModel.FaultException`1[Tridion.ContentManager.CoreService.Client.CoreServiceFault]: Name, File name must all be unique for items of type: Page within this Structure Group and its BluePrint context. Source or sources of conflict: tcm:xx-xxxx-xx. (Fault Detail is equal to Tridion.ContentManager.Core Service.Client.CoreServiceFault).

Tridion does not like the two filenames being index, even though they have different extension provided by the Page Template.

Is this a bug, or by design? Any ideas?

  • 2
    Not a bug, by design. Tridion cannot rely on you not changing the template – Nuno Linhares May 21 '13 at 23:37
  • 1
    @Nuno, why not? Would it not be possible to catch this event and not let the user save the page if another one with the same filename and extension exists. – Nickoli Roussakov May 21 '13 at 23:46
  • 1
    I think he means I create pages as described above, one with .jsp and one with .html. Then at a later date I go and change my PT's to both be say .html. To allow this, Tridion would have to re-check every page to ensure that they were unique before allowing you to save the PT update. – Chris Morgan May 21 '13 at 23:50
  • yes, and that's only a small method via the event system. – Nickoli Roussakov May 22 '13 at 3:34
  • Small method to check potentially millions of pages? – Nuno Linhares May 22 '13 at 10:25
7

Yes this is by design in that if you change the page template on your 'index' page, you may end up with the extension .html, .jsp, depending on the extension configured in the page template.

I do agree with Nick's comment that perhaps the page name should be allowed and the error should be raised when the same extension is attempted.. that said, i've never had this as an issue.

Perhaps you could call the html page 'default'? I'm sure there's a simple solution to this on the web-server end.

  • Yes, looks like I'll have to handle this on the web-server. I agree with you both, this should be allowed, and only prevented at the time a conflict occurs. My use case is quite obscure, requiring multiple index pages per directory. But, I think instances involving CSS, JavaScript etc could be valid cases to allow this. Not the best example, but maybe global.asax & a global JavaScript file (global.js). Anyway, that's over thinking it. Thanks for the answer! – Chris Morgan May 22 '13 at 4:43
  • It sounds like a simple task to move the check to the Page Template, but I'm sure that can lead to a huge performance impact when creating/changing Page Templates, as then on every save of a Template, this check needs to be performed for all Pages using it, where right now the check is only on the current Page against the Folder content. – Bart Koopman May 22 '13 at 9:18
4

I would say this is by design. Imagine the scenario of accessing the index page without actually specifying /index.html, e.g. instead of /my-sg/index.html you would use /my-sg. The web server might freak out.

  • 1
    Well, that is more of a delivery configuration puzzle, over which one takes priority. I admit this is an unusual requirement, but it would be / is already handled on delivery web server. My problem is creating them in Tridion in the first place. – Chris Morgan May 21 '13 at 23:52
  • 2
    In IIS for example, you can set multiple default documents, and the order in which IIS attempts to find them. Normally they are different names like index.html, default.html, home.html vs index.html, index.jsp, index.aspx etc.. – Chris Morgan May 21 '13 at 23:55
4

As mentioned, it is by design, so lets look at some options you have to get around this:

  • Use different file names and allow for multiple default documents on your webserver

Not sure if this next one works, but worth a try I guess

  • create a second structure group, and on the presentation server create that as a symbolic link pointing towards your first one

If option #2 works (not sure if the Deployer allows publishing to that symbolic link location, and you have to make sure it is created before you start publishing), you will have to make sure that you manage that duplicate filenames are not created this way, as that obviously will lead into unwanted situations. Another issue you might have is with dynamic links, as from a SDL Tridion perspective this Page is in a different location.

  • Or use different file names and set up a redirect on your server. – Dominic Cronin May 22 '13 at 10:51
  • Looks like I will handle it with a redirect. I wanted to handle it in Tridion, as it is a temporary requirement. Handling it in Tridion means little/no additional work when it is time to get rid of it; simply unpublish and delete the unwanted pages. I'll have to add a task to remove the redirect when it is no longer needed. Thanks! – Chris Morgan May 22 '13 at 16:34

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.