Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: call static page in center function  (Read 4119 times)

adamos

  • Newbie
  • *
  • Karma: 0
  • Posts: 43
call static page in center function
« on: December 12, 2007, 06:06:41 PM »

Hey guys, for a week only in sNews, i progressed a LOT. i will have the website up in 2-3 days. so far its great. i have few minor issues that i need help.

on my side bar navigation i have a Links section. I need to call the static htm file in the center function. i.e. when you click on the link to show the html page in the center function.

is any way of doing that?

Thanks,

Adam
Logged

Joost

  • Guest
Re: call static page in center function
« Reply #1 on: December 12, 2007, 06:20:20 PM »

Create a page or article in sNews and past the body content of the html file in the textarea. The body content is everything between <body> and </body>.
Logged

adamos

  • Newbie
  • *
  • Karma: 0
  • Posts: 43
Re: call static page in center function
« Reply #2 on: December 12, 2007, 06:44:57 PM »

Joost, thanks for the fast reply - but my side nav bar is a static html code with links. what i was trying to say is to click on the link of the static html and call the article with the html code in the center function. it sounds confusing even for me - look at the picture. Related links - its a <li> with links directing to other pages. the alpha implementers is an html that i need to put in the center function.


Thanks again,

Adam
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: call static page in center function
« Reply #3 on: December 12, 2007, 07:55:49 PM »

I went through this exercise with version 1.4. It was necessary to create a customized module and call that module into index.php just above the center function with... as an example:

Quote

<?php
if (get_id('category') == 'mypages') {include ("modules/mypages/mypages.php"); my_pages();  }
else { center(); }
?>


The mypages module folder is located in the modules directory in the site root. The mypages module folder contains mypages.php which contains a function named my_pages. This function contains the script which determines which of several html page-files to display... and the associated html page-files (an an image folder with images used in them) are contained in the same module folder. I was then able to display the pages, copy down the URLs to them, and use them in the hard-coded menu(s) used within the module's html page-files and anywhere else I wanted them.

Of course, this module approach also works with 1.5 and 1.6... but as Joost points out, there's no need to in 1.6.
You can take an existing html file and strip out all the script, keeping only the portion in between the <body> tags, and re-save it in a directory where you will keep all your static files... lets call the folder staticfiles for this example. Then, to display its contents in the sNews center()... make a new page with the appropriate title... insert the folder-name/file-name in include tags in the textarea, assigm the page to your preferred category... save it and it will display when you click the sNews-generated link to it. For more information on this easy technique... read this page on Creating Files for Inclusion.
« Last Edit: December 12, 2007, 07:57:39 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adamos

  • Newbie
  • *
  • Karma: 0
  • Posts: 43
Re: call static page in center function
« Reply #4 on: December 12, 2007, 08:07:21 PM »

what i would do without your help :)

problem solved - i am struggling to get the website done. i am 80% done. now i need to add the phpEvent calendar. but there are so many edits in the forum about php event calendar and the write up is not so clear.

@ Keyrocks.

Did you figure out completely to include the php event calendar in sNewsMU 1.6?

Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: call static page in center function
« Reply #5 on: December 12, 2007, 08:40:38 PM »

Did you figure out completely to include the php event calendar in sNewsMU 1.6?
No... not yet... and I've sort of put it aside for a while until I get some other projects out of the way.  :P
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU