The vB Geek

The vB Geek (http://www.thevbgeek.com/index.php)
-   Geek Article and Review System (http://www.thevbgeek.com/forumdisplay.php?f=26)
-   -   How to make custom field data show up in templates? (http://www.thevbgeek.com/showthread.php?t=3556)

pixie 07-26-2007 12:08 AM

How to make custom field data show up in templates?
 
Hi all,

I'm having trouble using custom fields in GARS.

It's not a problem to setup the correct field type and bind it in using the checkboxes in the forum type.

All of the additional info-fields I setup also show up correctly when creating a new thread.

But how can I kamke the data that is put into the form display in my template?

Some of you might know the Release/Install-Addon. There is a checkbox-type of field in it, which allows for the selection of additional script options.

I want to use the exact same thing only with different options. How can I achieve this?

Thanks! :)

pixie 07-26-2007 12:20 AM

Alright, sorry, guys... I got it! ;)

I simply had to put $post[fieldID] in my template! GREAT!! :D

Thanks anyway!

pixie 07-26-2007 03:57 PM

Alright, slowly I get a hold on things! ;)
 
Alright, now that I have understood how custom fields work and what power they hold, can somebody please help me with the following:

I would love to put a custom field holding a company name directly before the title form field in GARS_newthread. Setting up the field and putting it into position is not a problem, but how can I achieve, that the value from the company name field becomes part of the title?

EXAMPLE:
  1. I type the following into the company name field: Sweets Unlimited Inc.:
  2. I type the normal title of the post into the title field: Assistant Manager wanted
Now, when I hit 'publish new thread' I want the title of the thread to be:

Sweets Unlimited Inc.: Assistant Manager wanted

It must be possible, isn't it?! Somebody please help!

Half Pint 07-29-2007 12:39 AM

hi there pixie, u might be able to help me... u said that to get custom fields to show up, u need to put $post[fieldid] well i put that, the feild id iwant is '5' or is it 'gars5' im confused, i tried both of them and it didnt work. please help me

Thanks
Half Pint

pixie 07-29-2007 12:50 AM

Hi there,

yes in your case it's gars5. Simply put $post[gars5] into your template - maybe in a table or div or where-ever - and it should work like a charm! :)

Webmist 07-29-2007 04:48 PM

Quote:

Originally Posted by pixie (Post 20996)
Setting up the field and putting it into position is not a problem, but how can I achieve, that the value from the company name field becomes part of the title?

EXAMPLE:
  1. I type the following into the company name field: Sweets Unlimited Inc.:
  2. I type the normal title of the post into the title field: Assistant Manager wanted
Now, when I hit 'publish new thread' I want the title of the thread to be:

Sweets Unlimited Inc.: Assistant Manager wanted

It must be possible, isn't it?! Somebody please help!

From my understanding of what you want to do. It would be the GARS_thread template and Showthread template to edit. I've done something similar in the past and made custom templates so it does not show on the regular forums. So to keep it from showing on all forums you would need to create custom templates and/or a custom module to show it on. Otherwise you would end up with that prefix on all your forums.
Just add $post[garsX] - $post[garsy] to the $thread[threadtitle] format in the templates.


All times are GMT. The time now is 08:20 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.