Page 1 of 1

news or blog with different template fields

Posted: Tue Jun 09, 2009 5:51 pm
by louisk
I'm wondering of something is possible.
I have a website where I want to display a portfolio, a songs section and a video section.
When I post a new video for example, I would like to use (let's say) the news module, with custom fields, specially for the video section. However, I would like to have the same thing for portfolio and songs. But when I ad a special field, its always visible.
Is it possible to assign custom fields to a specific template and then choose that template upon creating a new item (post)? Just like when editing pages. When you select the template, the page reloads with the appropriate (custom) fields.
Hope some one can help.

Re: news or blog with different template fields

Posted: Wed Jun 10, 2009 10:47 pm
by jmires
I'm looking to do the exact same thing. One possibility might be to tie custom fields to certain categories. (in the OPs example, a category of news items called "video" that has certain fields associated with it, different fields for other categories).

Is this currently possible?

Re: news or blog with different template fields

Posted: Thu Jun 11, 2009 3:42 pm
by louisk
LOL, I'm so glad I'm not the only one, and you understood what I am trying to accomplish.  ;D

@jmires: yea, this would be fine too  :)

With the Expression Engine CMS it works just like this. You assign custom fields to templates, then you have a nice form that is specifically designed for the content you are adding.

Home some genius can add this to CMSMS.
Cheers

Re: news or blog with different template fields

Posted: Thu Jun 11, 2009 8:25 pm
by Jeff
In the news module add your "field Definitions"(custom fields). Then edit your template so in the extra field section it only displays the fields you want.

ie add {if $field->name == "video detail"}

Code: Select all

{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
     <div class="NewsSummaryField">
        {if $field->type == 'file'}
          <img src="{$entry->file_location}/{$field->value}"/>
        {else}
          {$field->name}: {eval var=$field->value}
        {/if}
     </div>
  {/foreach}
{/if}

Re: news or blog with different template fields

Posted: Fri Jun 12, 2009 1:56 pm
by louisk
Thanks for your reply  ;D
Yess, I know, this is one way of going about it. However, it's not a very nice one, because, when filling out the form, you'll see all the forms field, even though you only use a specific few.