Ignore name on publish

Screenshot of Environment variables screen

Screenshot of Environment variables screen

One really useful feature of SiteManager is the ability to specify section names that you would not like published to the server. A perfect example is sections that are being used to store related content.

Example

On our website at St Andrews if we want contact information to appear in the right-hand sidebar then we simply add a sub-section called rel_contact and we have a navigation object that pulls that content into a particular place in the style.

We’ve defined quite a few names for related content, almost all of them begin rel_…, e.g. rel_documents, rel_forms, rel_internal_links, rel_javascript, etc. Obviously, we don’t want these sections to be published so we simply add these section names we don’t want published out in the ignore-name-on-publish variable.

Configuration

You can setup this feature using an environment variable within TOOLS > CONFIGURATION > ENVIRONMENT (tab).

The variable name is ignore-name-on-publish-x, where x is the number of the channel that you wish to exclude these from.  So if your main website is published on channel 1 then the variable name would be ignore-name-on-publish-1.

Caveats

Now, should you move to a new website design, published on a different channel, make sure you remember to create a new ignore-name-on-publish-x variable otherwise your new site will be littered with unrequired directories.

This is the bit that we missed.  We didn’t realise that the number at the end referred to the channel.  You can get the channel ID from the URL when you go to TOOLS > CHANNELS

And while I’m at it, also make sure that if you are switching over from one channel to another that you change the output directory on the old channel.  Because if you leave it, and it’s pointing to the same directory as the new channel then there is a chance that if you publish out the old channel (by accident, or curiosity, or whatever) then you’ll be left with a right mess!

Can you tell that I’m speaking from experience here?

There are no comments on this post

Leave a Reply