Skins

Can I use text (.txt) files to create static pages in Nucleus?

Scenario:
"The method for managing static pages in Nucleus in the FAQ article "How do I use Nucleus to manage my static content?" is too difficult for me; can I use something simpler like text (.txt) files?"

Original forum thread (thanks, Sonja!):
http://forum.nucleuscms.org/viewtopic.php?t=14708

Method:

  • Create your static content in a plain text file and save it. For example, if you are creating an about page, put in your static content and save the file as about.txt.
  • Upload your text file(s) to the directory of the skin you are using. For example, if you are using the default skin, upload your about.txt file to the /skins/default/ directory.
  • Create a new category in your Nucleus administration area and note the category id. In our example, we will create a category called "About" and note it has a category id of "2".
  • In your admin area, click on "Skins" under the "Layout" section and choose to edit the Main Index skin part of your skin. In our example, we will click on the "Main Index" link in the default skin row.
  • Look for the following line of code:
    <%blog(default/index,X)%>

    where X is a number and replace it with this code:

    <%if(category,catid,X)%>
      <%include(static.txt)%>
    <%else%>
      <%blog(default/index,Y)%>
    <%endif%>

    where X is the category id of your new category created just before, Y is the number of posts you would like on your main page and static is the name of your static content text file. So in our example, we would put:

    <%if(category,catid,2)%>
      <%include(about.txt)%>
    <%else%>
      <%blog(default/index,10)%>
    <%endif%>
section: Skins | submitted by Leng on 2007.Feb.24 | 5822 views

item rate
Total votes: 2 - Rating: 10.00

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10