I need to do some new functionality which allow users to select some feature in Page Metadata and with this check selected the Page should be published with another Page Template (this Page Template includes another code and another extension). Is it possible to do that with Core Service, via Templating, Anguilla Framework or some develop in the Event System? Thanks in advance.
-
Yes, it is possible. I would create a custom page with intuitive custom controls that invoke Tridion functionality via the Core Service. IMO having one page's metadata control another page and its template could get pretty confusing for the editors.– Nickoli RoussakovOct 1, 2018 at 14:48
1 Answer
I'm definitely a fan of feature-based CMS development or design where your editor's selection can adjust backend or website functionality. Your content model seems like a familiar approach, though some background could help.
After working in product development, I'd also recommend:
- Going for the basics, or templating in this case. Based on the editor's selection change what you render.
- Putting code where you want to maintain it (templating or views if you render in delivery)
- Validating your end-to-end solution with users, developers, and however you handle support
If possible, I'd really consider if the user could just change the template themselves.
Here's why I wouldn't recommend the other approaches as a first choice, at least without a good reason to adjust the approach.
GUI Extension
GUI extensions are excellent for adjusting your editor's experience but your logic is already covered by the editor's selection and any templating or view logic you develop.
It also depends on how much you want to maintain such code.
@Nickoli's recommendation for a Custom Page could indeed help for configuration and might be easier to maintain and upgrade. But I'd only consider the Core Service if you're changing other items in the CMS, especially since Custom URLs already give you access to a script that lets you manipulate fields selections in a given form view.
Event-System
Perhaps you might change the selected template when the editor selects a specific keyword, but the change won't be as clear to the user ("why did the template change?") and I can see problems having to revisit this for every new "feature" and adjustment.
If you really need to change the rendered output, it makes sense to put that logic with whatever renders your output (in Content Management or Content Delivery). Automation through the Event System seems like overkill in this case.
Finally, it'll also depend on what you're willing to build and maintain while balancing the current use case against potential changes.
-
Thank you for your answer Alvin, it helps me a lot!! Finally we consider the best approach is to duplicate the Page to change the Page Template because if you change the Event System to do that, the editors couldn't see with what Page Template the page has been published and for System Administrators would be really difficult to control what pages are in the File System compared with the Page published in the CME. Oct 3, 2018 at 8:30
-
Cool! Nice to hear you have something that works for you, admins, and editors. Cheers! Oct 3, 2018 at 14:01