CMS.File as a page and editing this file

Jon White asked on July 9, 2015 16:48

Hi there,

I'm developing an intranet (my first), I have implemented 'latest news' and 'latest documents' as repeaters to list these in each department page.

The news uses a intranet.news custom page type that links to a new page with the full news article, then at the top has an edit contribution so it can be edited/deleted etc.. by a user. No issues there.

The documents use the CMS.File page type, which is selected as it can be used with versioning and doument libraries. Fine. This is all ok except when i want a user to click on it and edit; the getdocumenturl() transformation just opens the actual file attachment in a window when I'd like it to open a new page so i can add text (and other fields) and the 'edit contribution' web part.

Yes i could use a document library (except that's almost redundant on V9), I just sometimes find the document editing/uploading process a bit user-unfriendly.

The way i see it i have these options:

  • Find a way to link the CMS.File to an actual page where it can be edited. The ideal scenario.
  • Unlock the 'edit page' button for user where the 'edit' buttons will appear on the repeater.
  • Link to a separate page with a document library on it (although Kentico are dropping this and i just think it's convoluted)

Can anyone advise me on what they do for intranet users that gives an easy way to edit and display the files? Or advise if i can give the CMS.File page type a page template.

Thank you in advance, i apologize for the long post.

Jon

Recent Answers


Juraj Ondrus answered on July 27, 2015 10:26

Hi,

If you want to allow the users to edit the CMS.File pages in the same way in the user contributions, you need to configure the contributions to allow this page type. You can have either separate page for editing the files or, you can add the page type to your current contribution web parts - specify the allowed page types properties in those web parts.

0 votesVote for this answer Mark as a Correct answer

Jon White answered on July 27, 2015 11:23

Hi Juraj,

Thank you for this answer, I was looking more towards how the CMS.File functions - I wanted it to link to a page with template (when clicking a link from a transformation).

I can edit fields using user contribution but i want to create a page template that can show the data from these fields.

Jon

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 30, 2015 09:56

Hi,

Thank you for clarification. The CMS.File page type is special. It is hard-coded that it acts like a file - so the response headers are telling it is a file. If you want to have a page with some template, then I would recommend using custom page type with file upload field and then display the file using some web part on the page template.

0 votesVote for this answer Mark as a Correct answer

Jon White answered on July 30, 2015 10:27

Hi Juraj,

Thank you for the clarification, this is what I thought.

I only used CMS.File page type for the document library feature and versioning of files.

Or can I use a custom file type as you've mentioned and use versioning and the document library with it too? (I thought these only worked with CMS.File)

Thanks Jon

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 30, 2015 10:49

Hi,

Document library works with CMS.File only - however, this feature will be removed in Kentico 9 (read more). I would use e.g. media library instead or if you need the files in the content tree, you can still store them in the tree and use repeater or attachment web parts to display them.

So I do not recommend to use this module. For custom page types you can use versioning as for any other page types - either with or without workflows.

0 votesVote for this answer Mark as a Correct answer

Jon White answered on July 30, 2015 11:56

I am concerned about the drop of the document library as this was integral to us.

I will need to explore the versioning, I need to allow front end users to see the version histories, is this possible with custom file type, I know I have seen this with the document library?

Thank you for your help with this

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on August 18, 2015 13:46

Hi,

The custom page will have the version history as well - if it will be turned on, e.g. as versioning without workflow.

0 votesVote for this answer Mark as a Correct answer

Jon White answered on August 18, 2015 14:24

Hi Juraj,

Thanks again for your help. I've decided to move away from CMS.File and create a custom page type that acts as a page, in regards to versioning that's fine.

One thing the document library has is the ability to roll back to different versions by the user on the 'front end'. Can I incorporate this rollback versioning within the page type form control somehow? so a user can use edit contribution and rollback? This is to avoid users using the content tree.

Thanks Jon

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on August 19, 2015 13:33

Hi,

This can be achieved by using the On-site editing. Then, the editor can use the properties button to get to the versioning, sample screen shot.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.