Author Topic: How to add a new, custom template page  (Read 241055 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
How to add a new, custom template page
« on: April 06, 2003, 02:31:41 AM »
By using a built in feature found within index.php, it is possible to add your own custom template pages that are processed by 4images. This lets you create a new html template that supports many 4images features. In fact, your new template can use whatever you find inside the home.html template.

For example, if you want to create a Frequently Asked Questions page for your visitors:

  • Copy one of the existing templates like "error.html" to "FAQ.html"
  • Remove the {lang_error} {error_msg} from "FAQ.html"
  • Add your FAQ information to "FAQ.html"
  • Upload "FAQ.html" to the your template directory where you keep "error.html"

You can link to the new FAQ page by using a URL like the following example:
http://www.example.com/4images/index.php?template=FAQ

Please note that URLs are CaSe seNSitIve!
« Last Edit: November 24, 2005, 09:35:46 AM by V@no »

Offline jdbinion

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: How to add a new, custom template page
« Reply #1 on: November 23, 2005, 05:23:54 AM »
I have tried this method many times...I can't get it to work. I used the home.html as my source to save. Saved it as...aboutus.html
On the original home.html..I added a link to the aboutus.html as you described. I keep getting a 404 file not found. The link I used was just as you describe and I  tried every variable I could think of. Still nothing.
Should this link work using: http://www.mysite.com/4images/index.php/aboutus
Or do I  need to create a new php for this??? Totally confused :roll: Any help would be greatly appreciated. If I can get one link working..I could then use the same process to create more.
I have searched and searched the FAQ, and everywhere else to find the answer before asking but, there's not much info on this topic......Thanks a heap in advance   Regards, Jeff

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to add a new, custom template page
« Reply #2 on: November 23, 2005, 06:21:20 AM »
its index.php?template=aboutus
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jdbinion

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: How to add a new, custom template page
« Reply #3 on: November 23, 2005, 02:34:01 PM »
V@no...I tried that as well. Exactly as written in Chris's example. Still got the 404 file not found. In his example using the error.html template, he deletes the {lang_error} {error_msg}. Is there something in the Index.html template code on my aboutus.html that needs to be deleted to make it function ?
That's the only thing I can see that I might be doing differently than his example. Thanks for your help..Jeff

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: How to add a new, custom template page
« Reply #4 on: November 23, 2005, 02:50:22 PM »
can we take a look to the Gallery and in to the Template File?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to add a new, custom template page
« Reply #5 on: November 23, 2005, 03:07:55 PM »
404 error? doubtfull...
How about this idea: you do exactly as it sais in the tutorial, ones you got it working, then you do the changes you want? ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jdbinion

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: How to add a new, custom template page
« Reply #6 on: November 24, 2005, 01:03:05 AM »
can we take a look to the Gallery and in to the Template File?
Acidgod...please do. The website address is: http://www.latinamodelo.com   I've tried this exactly as described and still no luck. I have created another link...unrelated to my site that opens in a "New Window". It works without a hitch so, I feel it's something in the link path that is not correct. The links I am working with are in the left of the table below the Random Image. About US..(doesn't work)  Free Translation..(works fine). Awaiting your opinion...Thanks again for your help.

Offline jdbinion

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: How to add a new, custom template page
« Reply #7 on: November 24, 2005, 03:07:24 AM »
V@no...I folllowed the directions carefully. I'm still getting the same "Page not Found". If you look at my last post, you can see the site and try the link. You see the link I've created goes exactly as described.
http://www.latinamodelo.com/4images/index.php?template=aboutus  You'll get the same results "Page not found".
If you access the aboutus.html directly using this path:
http://www.latinamodelo.com/templates/default/aboutus.html
You will see the html page is there.  :roll:  Any more suggestions ?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to add a new, custom template page
« Reply #8 on: November 24, 2005, 09:38:13 AM »
Sorry, but DOH! you dont have 4images folder which you are trying to access.
http://www.latinamodelo.com/4images/index.php?template=aboutus
http://www.latinamodelo.com/index.php?template=aboutus
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: How to add a new, custom template page
« Reply #9 on: November 24, 2005, 10:26:22 AM »

Offline jdbinion

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: How to add a new, custom template page
« Reply #10 on: November 24, 2005, 01:14:04 PM »
THANK YOU so much for all your help!! I wasn't aware I was supposed to upload that folder. As you already know, I am new to PHP. By the description given in the original idea of this thread: I thought somehow that file path accessed 4images to do the processing of the page. :oops:  But, that information opens another door I hadn't even considered. :idea: Thanks again..V@no & Acidgod

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to add a new, custom template page
« Reply #11 on: November 24, 2005, 02:39:54 PM »
I agree, the example in the tutorial could confuse beginners, I've updated it, should be more clear now :)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jdbinion

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: How to add a new, custom template page
« Reply #12 on: November 29, 2005, 08:01:16 AM »
O.K...I had successfully figured this part out but now, I've added a new template style. 4darkm by Bali...so what would my file path be to the new html pages now since they are in the 4darkm folder ??? This has me stumped again.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How to add a new, custom template page
« Reply #13 on: November 29, 2005, 08:16:06 AM »
Just add your new template into your 4darkm folder, that's it.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline jdbinion

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: How to add a new, custom template page
« Reply #14 on: November 29, 2005, 03:46:43 PM »
I did add the new html template page to the 4dark folder but, the link example above doesn't work now. It just goes back to the home page.