news or blog with different template fields

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
louisk
Forum Members
Forum Members
Posts: 89
Joined: Wed May 30, 2007 7:40 pm

news or blog with different template fields

Post 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.
Last edited by louisk on Thu Jun 11, 2009 3:43 pm, edited 1 time in total.
jmires
Forum Members
Forum Members
Posts: 24
Joined: Thu Apr 02, 2009 7:32 pm

Re: news or blog with different template fields

Post 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?
louisk
Forum Members
Forum Members
Posts: 89
Joined: Wed May 30, 2007 7:40 pm

Re: news or blog with different template fields

Post 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
Last edited by louisk on Thu Jun 11, 2009 3:45 pm, edited 1 time in total.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: news or blog with different template fields

Post 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}
louisk
Forum Members
Forum Members
Posts: 89
Joined: Wed May 30, 2007 7:40 pm

Re: news or blog with different template fields

Post 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.
Post Reply

Return to “CMSMS Core”