Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8592533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:46:22+00:00 2026-06-11T23:46:22+00:00

Event System handler code: [TcmExtension(My Handler)] public sealed class EventSystem : TcmExtension { public

  • 0

Event System handler code:

[TcmExtension("My Handler")]
public sealed class EventSystem : TcmExtension
{
    public EventSystem()
    {
        EventSystem.Subscribe<Page, PublishEventArgs>((page, e, phases) => {
            if (shouldTerminatePublishing(page))
            {
                throw new Exception(ex, page);
            }
        }, EventPhases.Initiated, EventSubscriptionOrder.Normal);
    }
}

With the code above when multiple pages are being published and Event System is only about to block one of them (by throwing an exception), then all pages are effectively prevented from being published too. “Ignore Failures While Generating Publishable Content” check box does not affect this behavior.

How to prevent any given page from publishing but still allow all the rest to be published?

EDIT

Updated code as per Quirijn’s suggestion:

public class MyResolver: IResolver
{
    public void Resolve(
        IdentifiableObject item,
        ResolveInstruction instruction,
        PublishContext context,
        ISet<ResolvedItem> resolvedItems)
    {
        var page = item as Page;

        if (null != page && instruction.Purpose == ResolvePurpose.Publish)
        {
            try
            {
                // Evaluate whether publishing is allowed
            }
            catch (Exception ex)
            {
                resolvedItems.Clear();
            }
        }
    }
}

Some objections (or rather follow-up questions) so far:

  1. There’s no sensible way to provide explicit feedback to the user when item gets excluded (except advising to check “Show Items to Publish” option), is there?
  2. Custom resolver must explicitly account for all items types, that is: not only for ‘Page’ but also ‘StructureGroup’ and ‘Publication’, must it not?
  3. Given that evaluation code might be expensive (web service call), is there any way to cache it’s result at least between preparing “Show Items to Publish” list and performing actual publishing? (In such case evaluation occurs at least twice).

EDIT 2

After looking into standard resolvers’ implementation:

  1. Is it necessary/preferably to implement IBulkResolver as well?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:46:23+00:00Added an answer on June 11, 2026 at 11:46 pm

    You shouldn’t do this in the event system but in a custom resolver. This is a piece of code which gets executed to determine which pages / components should be effectively published when an item is put in the publish queue.
    Here you can filter out any page or component which you do not want to be published.

    See How to remove items from publishing using a Tridion Resolver?.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following code in the FormCreate event handler to create a system
I have the following code public abstract class Event { public void fire(Object... args)
The listener is: public void renderer(ActionEvent event) { System.out.println(here=========================); System.out.println(); System.out.println(); System.out.println(); System.out.println(); System.out.println();
Here's my code: Public Class Form1 End Class Public Class Form1Handler Inherits Form1 Private
I have some code that starts a process and hooks up an event handler
I have a System.Threading.Timer that calls its appropriate event handler (callback) every 10 ms
Using this code, I may register a global event handler: [NSEvent addGlobalMonitorForEventsMatchingMask: NSKeyDownMask handler:
I have a form called frmLogin. I have code within the Login_1Authenticate event handler
So I setup a System.Timers.Timer and have a handler for the Elapsed event. It
I have created a TcmExtension named WorkflowEventSystem that has an event handler subscribed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.