4images Forum & Community

4images Help / Hilfe => FAQ, Tips => Topic started by: Chris on April 06, 2003, 02:31:41 AM



Title: How to add a new, custom template page
Post by: Chris 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!


Title: Re: How to add a new, custom template page
Post by: jdbinion 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


Title: Re: How to add a new, custom template page
Post by: V@no on November 23, 2005, 06:21:20 AM
its index.php?template=aboutus


Title: Re: How to add a new, custom template page
Post by: jdbinion 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


Title: Re: How to add a new, custom template page
Post by: Acidgod on November 23, 2005, 02:50:22 PM
can we take a look to the Gallery and in to the Template File?


Title: Re: How to add a new, custom template page
Post by: V@no 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? ;)


Title: Re: How to add a new, custom template page
Post by: jdbinion 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.


Title: Re: How to add a new, custom template page
Post by: jdbinion 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 ?


Title: Re: How to add a new, custom template page
Post by: V@no on November 24, 2005, 09:38:13 AM
Sorry, but DOH! (http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons6/40.gif) 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


Title: Re: How to add a new, custom template page
Post by: Acidgod on November 24, 2005, 10:26:22 AM
Sorry, but DOH! (http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons6/40.gif)
(o:


Title: Re: How to add a new, custom template page
Post by: jdbinion 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


Title: Re: How to add a new, custom template page
Post by: V@no 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 :)


Title: Re: How to add a new, custom template page
Post by: jdbinion 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.


Title: Re: How to add a new, custom template page
Post by: V@no on November 29, 2005, 08:16:06 AM
Just add your new template into your 4darkm folder, that's it.


Title: Re: How to add a new, custom template page
Post by: jdbinion 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.


Title: Re: How to add a new, custom template page
Post by: V@no on November 30, 2005, 12:23:00 AM
Then you do something wrong, please post a link to your gallery (PM me if you dont want it to be public)


Title: Re: How to add a new, custom template page
Post by: jdbinion on November 30, 2005, 12:44:29 AM
V@no...here's the site address. http://braziltonewoods.com/4images/
Many thanks for your patience and assistance. Where would we illiterates be if we didn't have you ? :wink:


Title: Re: How to add a new, custom template page
Post by: V@no on November 30, 2005, 03:54:29 AM
I did add the new html template page to the 4dark folder
Where?
http://braziltonewoods.com/4images/templates/4dark/aboutus.html


Title: Re: How to add a new, custom template page
Post by: jdbinion on November 30, 2005, 06:32:20 AM
V@no..please look at the site again. There are 3 links: HOME link = index.php / Uploading Images: is the text for the second link but, the page is  howto.html  not aboutus.html         the third link text is Our Friends which is links.html
I've attached a screenshot of my FTP so you can see the file paths I've used and that the new html pages are there in the template file.

And these are the link assignments in the 4darkm.php
href="http://www.braziltonewoods.com/4images/index.php?template=howto.html">Uploading Images</a>
href="http://www.braziltonewoods.com/4images/index.php?template=links.html">Our Friends</a>


As you can see..both of these links takes you back to the index.html or home ???????????


Title: Re: How to add a new, custom template page
Post by: V@no on November 30, 2005, 02:42:03 PM
and what about the permissions? CHMOD 666?


Title: Re: How to add a new, custom template page
Post by: jdbinion on November 30, 2005, 02:55:53 PM
I don't have a clue what that means or where to find it. All I know is this process worked before adding the 4dark template. Now it doesn't. I haven't changed any permissions that I would be aware of.
O.K...I'm looking in my account info of the server in the file permissions. I don't see CHMOD 666...It has 3 columns:
                  Owner  /   Group   /  All
Templates:   RWX         R-X       R-X

So. when you ask: "What about the permissions CHMOD 666"..what permissions are you asking about ? For a particular category llike the templates file / one individual page / or the entire www ???? ANd where do yo find the CHMOD


Title: Re: How to add a new, custom template page
Post by: V@no on November 30, 2005, 03:04:13 PM
I haven't changed any permissions that I would be aware of.
And that could be the problem...
If you read 4images instrucitons (the instructions that came with the template could possible left out this), its clearly stated that all files in template folder must be CHMOD 666 (aka be readeble and writible by the web server account)


Title: Re: How to add a new, custom template page
Post by: jdbinion on November 30, 2005, 03:23:31 PM
All the files in the 4dark template folder are Readable and Writable in the Owner category. In the Group and All it's only Readable.


Title: Re: How to add a new, custom template page
Post by: V@no on November 30, 2005, 03:29:07 PM
CHMOD 666 is eaqual to rw- for owner group and all.

P.S. are you sure index.php and includes/page_header.php are original, unchanged files?


Title: Re: How to add a new, custom template page
Post by: jdbinion on November 30, 2005, 06:49:07 PM
O.K....I can't let this thing go. I need to get these links working. So, I'm sure the 2 php pages you mention are unchanged. As for the permissions, I set all of those according to the specifications in the 4images set up instructions. Links going to an external site work fine but, the links within the site I've created still take me back to the home page. Any other ideas ????????
This is really frustrating and I feel certain it is something to do with the file path of the links that stay within  this site. Please help if you can. I know someone has the answer because every other site I see has additional pages within their site. Does anyone know the answer to this ?


Title: Re: How to add a new, custom template page
Post by: V@no on December 02, 2005, 12:11:44 AM
And these are the link assignments in the 4darkm.php
href="http://www.braziltonewoods.com/4images/index.php?template=howto.html">Uploading Images</a>
href="http://www.braziltonewoods.com/4images/index.php?template=links.html">Our Friends</a>


As you can see..both of these links takes you back to the index.html or home ???????????

Oh, how did I miss that one!
you must not include the extension of the template, only the name:
http://www.braziltonewoods.com/4images/index.php?template=howto
http://www.braziltonewoods.com/4images/index.php?template=links
(see, no .html attached to it)


Title: Re: How to add a new, custom template page
Post by: jdbinion on December 02, 2005, 12:32:10 AM
THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! V@no...you are a llife saver. I've been up all night and at this all day trying every combination possible to get this to work. I knew it was some little minor thing that wasn't just right. You don't know how much I appreciate your help !! :mrgreen: :mrgreen: :wink: I can't thank you enough. :idea: By the way...I really like the layout of your site. Very organized with a simplicity that really works. You're the greatest. Best Regards, Jeff


Title: Re: How to add a new, custom template page
Post by: abda53bd on January 28, 2006, 09:41:43 PM
i think there used to be a page on it.. but how do i get it on a new .php/html page, so be able to see the {header} and {footer} info?


Title: Re: How to add a new, custom template page
Post by: V@no on January 29, 2006, 12:20:12 AM
without any modifications you can use these tags.


Title: Re: How to add a new, custom template page
Post by: abda53bd on January 29, 2006, 01:19:33 AM
im doing the PM mod.. but with the template im using, it has all of the menu, header, everything, under the header.html... and not under each individual template file html..

so it looks like this
{header}
page content
{footer}

i actually converted my other install of 4images to be this way, but this template came like that.. but the problem im having is that with the pm mod, it doesnt see any of the {header} content.. it just prints out.. {header} and {footer}
its been awhile since ive worked on any 4images code, if you havent noticed me gone for awhile lol.. and.. i forgot how to make this work


Title: Re: How to add a new, custom template page
Post by: killerwhale65 on March 09, 2006, 06:48:05 PM
hi,

what if i whish to integrate a php file instead of a html? How can i do that?


Title: Re: How to add a new, custom template page
Post by: mawenzi on March 09, 2006, 07:33:42 PM
1. FAQ
2. http://www.4homepages.de/forum/index.php?action=search;advanced
3. http://www.4homepages.de/forum/index.php?topic=4295.msg17676#msg17676


Title: Re: How to add a new, custom template page
Post by: Gwydion on April 06, 2006, 08:35:31 PM
Quote  [Expand]
you must not include the extension of the template, only the name:
http://www.braziltonewoods.com/4images/index.php?template=howto
http://www.braziltonewoods.com/4images/index.php?template=links
(see, no .html attached to it)

That solved my problem as well!
Would it be possible to put a summary of the correct instructions in the first post? Luckily it's only  a 2 page thread but still ...  I don't need it anymore now but I am sure many others would appreciate it.



Title: Re: How to add a new, custom template page
Post by: koikonut on May 06, 2006, 05:03:54 AM
Kann man die über ?template=... Pages aus einem anderen Ordner includen? Ich möchte aus dem Hauptverzeichnis zum Beispiel eine Kategorie-Liste includen:

domain.com/index.php --> includet:
domain.com/4images/index.php?template=categorylist

Muss ich dann CHDIR oder etwas in der Art machen beim includen oder geht das auf die Weise nicht?

Danke für die Hilfe, Konradin

----

Can they include a page that is processed by ?template=... from another folder? I want to include for example a categorylist from the root folder:

domain.com/index.php --> includes
domain.com/4images/index.php?template=categorylist

Do I have to use CHDIR or something like this for the include code or doesn't it work in this way?

Thx for helping, Bye Konradin


Title: Re: How to add a new, custom template page
Post by: V@no on May 06, 2006, 05:31:05 PM
For security reason such include is not possible.
Yet, you might want to try create a normal categorylist.html template with this code inside:
1
2
3
<?php
include("path/to/your/real/categorylist.html");
?>



Title: Re: How to add a new, custom template page
Post by: koikonut on May 06, 2006, 05:59:07 PM
I don't understand.  :?

So, how can I include 4images-Information from another page?

The categorylist that you have mentioned ist static, isn't it?

Thx for helping, bye Konradin


Title: Re: How to add a new, custom template page
Post by: ashfaq on July 19, 2007, 04:26:02 AM
If i am using SEO Friendly URL by editing .httaccess then will this adrese work ?
http://www.mydomain.com/4images/index.php?template=howto


Title: Re: How to add a new, custom template page
Post by: kai on November 27, 2007, 10:15:44 AM
A video tutorial, how to add a custom page, can be found here:

http://www.asian-lady.org/tutors/custom-page/custom-page.html


Title: Re: How to add a new, custom template page
Post by: jojomart on December 21, 2007, 04:09:51 PM
This is awesome!  I used this to add my contact form to my Wallpaper Downloads site - works very well!

Thanks,

Joanne


Title: Re: How to add a new, custom template page
Post by: Elfinee on August 10, 2012, 04:02:15 PM
Hi,

ich habe mir diesen Thread http://www.4homepages.de/forum/index.php?topic=4996.0 durchgelesen und noch Fragen dazu. Leider kann ich in dem Thread nicht antworten.

Ich bin mir da noch etwas unsicher. Also soll ich beispielsweise die error.html kopieren und in einem Editor einfügen?
Diese dann umbenennen in Beipsielweise faq?

Dieses lang_error und error_msg soll ich ja löschen. Nur diese Worte oder irgendwie ganze Abschnitte?
Und wo trage ich da meinen eigenen Text ein?

Hab das irgendwie nicht so ganz verstanden und bevor ich da irgendwie Bockmist baue, frag ich lieber mal nach :-)


Title: Re: How to add a new, custom template page
Post by: Saschilys on August 10, 2012, 04:16:24 PM
Jep, die error.html in faq.html umbenennen.

Um was neues zu schreiben, wie schon angedeutet die beiden Atribute löschen.
Am besten nimmst du dir ein WYSIWYG-Editor. Dann siehst du auch gleich, was du löschst und wie es am Ende aussieht.