Removing specific page type from CI

Gerard Young asked on March 20, 2020 10:12

Is it possible to remove a specific page type from CI?

For example I'd like to ignore all documents of type CMS.Blog.

I've been trawling the documentation but can't see a way to do this.

Recent Answers


Dmitry Bastron answered on March 20, 2020 10:19

Hi Gerard,

Have you tried the following in repository.config?

<IncludedObjectTypes>
    ...
    <ObjectType>cms.documenttype</ObjectType>
    ....
</IncludedObjectTypes>
...
<ObjectFilters>
    ...
    <ExcludedCodeNames ObjectType="cms.documenttype">CMS.Blog</ExcludedCodeNames>
    ...
</ObjectFilters>
1 votesVote for this answer Mark as a Correct answer

Arjan van Hugten answered on March 20, 2020 10:21 (last edited on March 20, 2020 10:21)

Hi,

I think you need to exclude the page type like this:

<ExcludedCodeNames ObjectType="cms.documenttype">
  CMS.Blog;
</ExcludedCodeNames>
0 votesVote for this answer Mark as a Correct answer

Gerard Young answered on March 20, 2020 10:33

Hi Dmitry, Thanks for that quick response.

Yes I have tried this to no avail. All of the documents still get created when I "serialise all objects"

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on March 20, 2020 10:59

Ah, ok, got you now.

In this case I think excuding will work only by NodeAliasPath, not by type.

<ExcludedCodeNames ObjectType="cms.document">/Blog1/%;/Blog2/%</ExcludedCodeNames>

And I think the main reason for this is the following. Imagine this structure:

  • Blog
    • Blog post 1
    • Blog post 2

If you exclude only Blog page type and leave blog posts to be serializable, this will bring an error during the deserialization. As the target system will not have a root node (Blog) hence it will not know where to insert child nodes. So I think NodeAliasPath with wildcard is the only option available for you.

0 votesVote for this answer Mark as a Correct answer

Jeroen Fürst answered on March 23, 2020 11:30

Hi Gerard, I was wondering why you want to exclude page types using CI. I would typically remove all unwanted page types like CMS.Blog. Hope this helps!

0 votesVote for this answer Mark as a Correct answer

Gerard Young answered on March 23, 2020 11:37

Dmitry This is still serialising the items in that path...

0 votesVote for this answer Mark as a Correct answer

Gerard Young answered on March 23, 2020 11:38

Jeroen, We have a CRM integration in place that creates These pages dynamically per environment.

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on March 23, 2020 11:43

What version are you using? Could you post your full repository.config file?

0 votesVote for this answer Mark as a Correct answer

Gerard Young answered on March 23, 2020 11:55

v12.0.51 You can find it here: https://pastebin.com/cjWbyy8u

0 votesVote for this answer Mark as a Correct answer

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