PDA

View Full Version : Bit templates :S


Nickeh32
03-18-2005, 08:11 PM
How do i insert a bit template into a page using another template?

Jolten
03-18-2005, 11:42 PM
they generally have a variable set such as $templatename_bit.
You just insert that variable into your main template.

If this is for a custom script, you'll need to evaluate the template in the script.

Nickeh32
03-19-2005, 09:45 AM
Like this?


eval('$newsbit = "' . fetch_template('newsbit') . '";');

Deaths
03-19-2005, 09:47 AM
Yes, add that code to the file which will call for the main template, then you can use $newsbit.

Are you wanting to actually make it display bits, like when displaying posts?
Because that's something completely different.

Nickeh32
03-19-2005, 10:03 AM
I did, it didn't work.

Yes thats what i'm trying to do.
I made a table in the bit template which contains the news.
Then i want it shown in the news page, templates confuse me.
How do i do it?

Deaths
03-19-2005, 10:10 AM
So, you want to create a newsbit, kinda like posts?

If so, do you want the news to be read from posts, or do you want to be able to add/edit news without adding/editing posts?

Nickeh32
03-19-2005, 07:52 PM
I've made a simple php script that takes news from a database.

But it won't display more than one row of the database, so i thought a bit template would do the job.