Mango



Thread: Generic Pages

Created on: 10/13/07 12:39 PM

New topic Reply    Page: 1  

Replies: 6
JoshRodgers


JoshRodgers's Gravatar
Joined: 07/24/06
Posts: 161

10/13/07 12:39 PM

Good morning,

I would like to add a couple non-blog related pages, such as Contact, Projects, stuff like that.

Was curious what you thought about approaching this using Mango? For example AsFusion.com has a contact page, projects page, archives, articles, etc...

How are those pages generated? I assume your not using the static pages option in the admin and that your using some sort of template. Are you using the Generic.cfm as the template for those pages, then adding in your own content?

Any guidance/suggestions you can provide would be great :)

Thanks!

Josh
Link | Top | Bottom
Laura

Wizard
Laura's Gravatar
Joined: 01/29/05
Posts: 1534

10/14/07 9:38 PM

Hi Josh,

I am using static pages in AsFusion. Some are plain static pages and some are static pages with custom template. For example, Archives is a custom template that contains <Archives> tags to loop over all the available months and categories. But About uses the default page.cfm template.

I don't think many people is aware of this feature, but you can create a special template for any of your pages. That is probably because if you don't have any special template, then the option will not show when creating/editing a page.

You would see it if you use the Movable type template, where I added an extra page template that doesn't have a sidebar.

The process is this:

1. You would create a template that would look pretty much like the page.cfm template in your skin directory. Save it with any name you want in the skin dir. You would make any modifications you want there, taking into account that in that page, you will have the page's information available, such as the content you added via the admin, the title, etc.

2. Then register your new page template in your skin.xml file. You need to specify the name of your cfm and a title that you will see in the admin later. It would look something like this:

<pageTemplates>
<template file="yourNewPageName.cfm" name="Your Template Title" />
</pageTemplates>

I don't remember whether or not you need to refresh your app, but I think it will just be there when you go to edit or add a new page.

3. In the admin, create your new page or edit one and then select the template in the option "Skin template" that should appear below "Parent Page".

You can see the example in the Movable type skin.

Laura

PS: My contact page is also a custom template that includes a plugin that I will probably enhance and add it to the list of available plugins.
Link | Top | Bottom
JoshRodgers


JoshRodgers's Gravatar
Joined: 07/24/06
Posts: 161

10/15/07 6:59 AM

Very cool, thank you for this bit of info this should help. I will let you know if I have any other questions.
Link | Top | Bottom
harryfear


harryfear's Gravatar
Joined: 10/06/07
Posts: 14

10/19/07 7:46 AM

I haven't yet been able to find a way to induce generic.cfm. What exactly is it for and how can I make use of it?

Many thanks, Laura.

Harry
Link | Top | Bottom
Laura

Wizard
Laura's Gravatar
Joined: 01/29/05
Posts: 1534

10/21/07 2:16 PM

&eventHi Harry,

generic.cfm in templates is usuallly used by plugins.

The comment subscription plugin uses it to display the subscription settings and to allow the user to unsubscribe. See this example:

[email protected]">http://www.asfusion.com/generic.cfm?action=event&event=subscriptionSettings&email=[email protected]

A link like this is received by the subscribers when a new comment is added in case they wish to unsubscribe:

[email protected]&type=comments">http://www.asfusion.com/generic.cfm?action=event=subscriptionSettings&entry=C06761E9-3048-2A53-70050C7C7A7B4EE6&email=[email protected]&type=comments

That email address is spam, so I will probably delete those subscriptions, you can change whatever you want.

(The links here are wrongly displayed, please copy from http:// to the end of the url and paste that in your browser)
Link | Top | Bottom
harryfear


harryfear's Gravatar
Joined: 10/06/07
Posts: 14

10/21/07 2:20 PM

Oh, thanks Laura.

I also see, having created a proper Generic.cfm page. That now it is present, it is used for errors instead of the error.cfm page?

Harry
Link | Top | Bottom
Laura

Wizard
Laura's Gravatar
Joined: 01/29/05
Posts: 1534

10/22/07 12:19 AM

Harry,

That's right. I had forgotten about the errors. Whenever there is an error, it will attempt to show it in the generic page (that usually has most of the things the other blog pages has), and if that gives an error too, then it shows a simpler version, error.cfm
Link | Top | Bottom

New Post

Please login to post a response.