Creating New Pages

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
Hi

I want to create some new pages on the site. I have created new topics and added the content accordingly.

How do I define what the templates are for the new pages and how do I add it into the menu system for the site?

Regards

Rob
Hace 13 años
Hi,

MENUS:

The CMS bit of NOP is pretty basic (so far) but you can do some cool things with topics and content pretty quickly.

As a rule of thimb, here's how I categorise content:

If it has something special in the page, like a user control or other dynamic content, it gets its own page.

If it has just html/content in there, it's happy as a topic.

To add a new page or a topic derived page to a menu is a simple as finding the ascx file that has the menu you want to edit, and adding the file or topic url to the list.

For example, the main info block is in InfoBlock.ascx. To add a new page, just edit the list in the ascx file.

(Make sure you follow the nop standards for getting URLs and link titles from Localisation etc).

I've done some pretty involved things with menus in nop, but one thing that I've found useful is to generate menus as topics, so you can edit these directly in the CMS and place them on any page you wish.

To do this just create a new control called SimpleTopic.ascx (or whatever makes sense to you), just have a literal in the ascx, and strip all the calls to unwanted fields from the code behind. Then just add Literal.text = Topic.Body, which renders the html (in this case a menu derived from a list).

So you now have a CMS enabled menu. Each time you want to add a link, just get the URL and add it in the Topic editor.

If you do this, make sure you add a Disallow: /Topic/MyMenu-1.asp or whatever to Robots.txt.

TEMPLATES:

Any page added as a Topic derived page will get its template based on the MasterPageFile Template defined in the header of the Topic.aspx file.

If you create a custom page, you can define which template to use. Bear in mind, nop uses nested master pages.

I've never done it or seen it done in Nop, but theoretically you could add some logic to Topics to define a master page in the editor that is added at Init. Cool :)
Hace 13 años
Many thanks for your help - I'm getting there.

I have created a new topic called Services.

I have added a new item to HeaderMenu.ascx and pointed the hyperlink to ~/topic/11-services.aspx

So far so good. It displays my topic content beautifully :-)

However, I haven't quite grasped the template part. I want this page to have the same template as the AboutUs page.
If I look in AboutUs.aspx I can see the master page is ~/MasterPages/OneColumn.Master

Where do I tell my Services topic that this is the template to use?

Actually I want to go further and have a two column template but that shows a menu on the left for my different services. However, one step at a time.

Thanks

Rob
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.