View Full Version : How to add page
tansks
11-03-2005, 01:44 PM
Hi,
I have a question here. How to add new page, such as policy, tos or partners page? Thank you.
Tim_Myth
11-03-2005, 05:00 PM
(I assume you already know how to create an HTML page from scratch)
Simply decide where on the page you want to link to your new page. At the very top? Then edit header.tpl. In the linkbar with many of the other "navigational" type links? That's in top_bar.tpl. At the bottom of the page? The edit footer.tpl.
Jim_Westergren
11-03-2005, 07:56 PM
An easy way to create the HTML page from scratch is to go to your dir and select view source then just copy the code.
Then change the middle part to what you want.
I tried to do it the other way with includes etc. etc. but didn't get anywhere with the smarty etc. The above is the easy way.
WebDesignPoint
11-03-2005, 09:12 PM
Here's how I created my TOS page.
Create a file called terms.php (or tos.php, etc) and add the following code to it:
Content visible to registered users only.
Then create a template called terms.tpl and enter the following code in it:
Content visible to registered users only.
Then link to your terms page (terms.php) in your navigation or footer.
I was looking for this. Great and thank you.
tansks
11-04-2005, 05:27 AM
Hi,
Thank you very much.
But is that possible to use a single php file to call all pages, such as page.php to call policy, tos, partners? Like page.php?id=policy and even rewrite as policy.htm
Is the following code correct?
RewriteRule (.*)\.htm$ /page.php?id=$1
Thank you.
WebDesignPoint
11-04-2005, 02:12 PM
Yes, that would be possible.
Your rewrite rule looks ok.
In page.php you would then use something like this:
Content visible to registered users only.
It's probably possible to use one template and display different content depending on the $_GET variable, but I don't know how off the top of my head.
Tim_Myth
11-04-2005, 02:40 PM
I'm only a week into my PHP book, but why wouldn't something like this work? Simply call three templates: header, body, and footer?
Content visible to registered users only.
In fact, you could very likely do this right in main.tpl by putting the conditional after header and top_bar are loaded and before the rows are calculated. Then instead of main.tpl printing categories or links, it would just include tos.tpl or partners.tpl.
tansks
11-04-2005, 05:19 PM
Thanks again. I will test it out later.
As a return I will link back to your site. Let me know which site you want me to link back. My directory is just up at here (www.myhostone.com).
Content visible to registered users only.
WebDesignPoint
11-05-2005, 12:02 AM
Thanks,
You can link to my Web Hosting Directory :)
Content visible to registered users only.
tansks
11-05-2005, 01:28 AM
I will setup your link maybe this afternoon.
Another problem, is there a way to show a few Featured Links (super Featured Links) on front page? Featured Links seem like just show on each category and not on front page. Thank you. :)
Content visible to registered users only.[/quote]
tansks
11-05-2005, 11:20 AM
I create a php file call articles.php. and a few tpl files as articles1.tpl...
Content visible to registered users only.
And add the following to .htaccess
Content visible to registered users only.
Page load fine if I enter articles.php?id=1, but when I enter articles1.htm it bring me to the frontpage. Same for links page which no passing argument. Am I missing something? Need your help. Thank you.
p/s: your link has been up.
WebDesignPoint
11-05-2005, 12:41 PM
You can use the code found {thread no longer active} to do this.
Content visible to registered users only.
WebDesignPoint
11-05-2005, 12:49 PM
That means your rewriterule's aren't working properly.
Try changing your .htaccess to:
Content visible to registered users only.
If the article links only uses numbers, try replacing the articles line above with:
Content visible to registered users only.
Content visible to registered users only.
Thanks for the contribution! This works great! :)
tansks
11-09-2005, 11:59 AM
Content visible to registered users only.[/quote]
I tested both, but still not working for me. When I key in links.htm/articles1.htm it bring me to frontpage. I even delete all cookies and temp files.
here is my .htaccess
Content visible to registered users only.
WebDesignPoint
11-09-2005, 01:57 PM
Have you got access to your error log? That should provide a bit more info on what might be causing the problem.
Also, try using the number rewrite rule I provided to see if that makes any difference.
thompson
01-08-2006, 11:22 AM
it´s my problem too.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.