4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Sunny C. on September 26, 2008, 10:54:51 PM

Title: Beschreibung mit If und endif / description with if and endif .. ??
Post by: Sunny C. on September 26, 2008, 10:54:51 PM
Hallo ist es möglich, dass man die Beschreibung mit einem {if description} ..... {endif description} setzen kann?
Oder generell wenn man neue Felder anlegt? Geht sowas?

--

Hello, it is possible that the description with a {if description} ..... {endif description} put it?
Or if you generally create new fields? Goes something?
Title: Re: Beschreibung mit If und endif / description with if and endif .. ??
Post by: V@no on September 27, 2008, 02:59:38 AM
If I understood your question correctly, yes, you can use {if description} ... {endif description} tags in templates.
Just make sure that you added information about your new field into includes/db_field_definitions.php

If you are talking about image description or category description, then its: {if image_description} / {if cat_description}
Title: Re: Beschreibung mit If und endif / description with if and endif .. ??
Post by: Sunny C. on September 27, 2008, 05:10:52 AM
Hello Vano,

No, so I thought not. I would generally know how such fields can create.

Sample:

I make a new field

1) i open includes/db_field_definitions.php
search
Code: [Select]
?>
add this
Code: [Select]
$additional_image_fields['image_myfield'] = array($lang['image_myfield'], "textarea", 1);
2) i open lang/LANG/main.php
search
Code: [Select]
?>
i add this
Code: [Select]
//-----------------------------------------------------
//--- Additional Fields -------------------------------
//-----------------------------------------------------
$lang['image_myfield'] = "My New Field";

3) i open templates/default/member_uploadform.html


Code: [Select]
{lang_image_myfield}
Code: [Select]
<textarea type="text" name="image_myfield" size="30" value="{image_myfield}" class="input" />
3a) öffne templates/default/details.html

Code: [Select]
{lang_image_myfield}
{image_myfield}

But I want this so

{if myfield}{image_myfield}{endif myfield}

Unless specified, it should not be displayed

Sorry for my Englisch, is Translate with Google :D
Title: Re: Beschreibung mit If und endif / description with if and endif .. ??
Post by: V@no on September 27, 2008, 05:14:36 AM
{if image_myfield} {image_myfield} {endif image_myfield}
Title: Re: Beschreibung mit If und endif / description with if and endif .. ??
Post by: Sunny C. on September 27, 2008, 06:45:53 PM
omgf.. so simple!

Best Thanks Vano!