CityDesk Articles

 

Why Can't An Article And A Folder Have The Same Name?

If you create an article named Foo in the same folder as a subfolder named Foo, the article will get renamed to Foo2.html when you publish your site. Joel Spolsky gives this explanation:

"It's a bit tricky but if you have a folder named index we don't let articles have the basename index, because we can't be sure you won't add a template family in the future with no extension which would cause a name conflict. So in general, right now, where articles are concerned, we err on the side of safety and don't let you reuse the same basename. But generating unique publishAs names is sort of a big logical morass :) If you're ever trying to debug something like this, pop open your site in Access and look at the sPublishAs field in the tblStructure table."

Back to Top

How Can I Put HTML In Extras Fields?

The fields under the Extras tab of an article support HTML content, but they don't have an HTML mode for editing. So it can be difficult to add or remove special characters or formatting.

The easiest way around this is to keep a 'scratchpad article' handy. Put the cursor in the Extras field you want to edit, and hit Ctrl-A Ctrl-C to select and copy the entire contents. Open your scratchpad article, put the cursor in the body, and hit Ctrl-A Ctrl-V to replace the entire body contents with your field's content. Now you can switch to HTML view and do what you need to do.

Once you've finished editing the item, hit Ctrl-A Ctrl-C to copy it all, then put your cursor back into your original Extras field and hit Ctrl-A Ctrl-V to replace it with the new contents. Easy!

Thanks to TK for this tip.

Back to Top

How Can I Create A Custom 404 Page?

First, create a new Article called something like "Error 404". In the body, explain that the requested page was not found and provide links to the main sub-sections of your site to help the visitor track down the page they were looking for.

Joel Spolsky had the great idea of adding "(404)" to the keywords of the most popular articles on your site, and then using CityScript to present a list of those articles:

{$foreach x in (keyword_contains "(404)")$}
...
{$next$}

Then you'll just need to know how to configure 404 pages on your web site host. If you have a control panel (such as the popular CPanel), it'll be fairly easy to configure. If you don't have a control panel, check out this site for a possible solution.

Back to Top

How Can I Find All Articles Linking To A Specific Item?

There are times when you want to get rid of an item (article, image, pdf file, whatever) from your site. But if you just delete it you'll often get lots of errors when you next publish your site, since you still have articles with links to that item.

Before you delete the item, right-click on it and select Copy Magic Name. Now select Edit -> Search, and in the Search For field right-click and select Paste. Click on the Search button, and it'll give you a list of all the articles that link to the selected item. You can now double-click on each article, and remove or modify the links so they no longer point to the item you want to delete.

Sometimes you can't see where in the article the link is. In this case, it's probably hidden somewhere in the HTML. Click on the HTML View button at the bottom of the Article window, and select Edit -> Find. Again, paste the Magic Name into the Find What field, and click on the Find button.

Back to Top