• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: News with Field Definition
PostPosted: Wed Jun 13, 2012 10:40 pm 
Offline
Forum Members
Forum Members

Joined: Fri Nov 28, 2008 10:28 pm
Posts: 127
Is anyway to add a Field Definition and have a spaces in the name,

This does work if I use this code. But I want do do a if tag

Code:
{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
 {$field->name}: {eval var=$field->value}
  {/foreach}
{/if}


I would like to something like this

Code:
{if $entry->Bottton News == '1"}
Show this Article on the bottom of page etc.
 {/if}


I know if made a field without the spaces it works.

I want make the back-end clean, I dont really want see BottomNews. I would like to have it so its says Bottom News not BottomNews

Can anyone advice me

Cheers

Andrew


Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Thu Jun 14, 2012 12:36 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 6609
Location: Fernie British Columbia, Canada
Try this:

Code:
{assign var='tmp' value='Bottom News'}
{if $entry->fields.$tmp->value}
  {* do something *}
{/if}

_________________
Follow me on twitter
--
if you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Tue Jun 26, 2012 10:13 pm 
Offline
Forum Members
Forum Members

Joined: Fri Nov 28, 2008 10:28 pm
Posts: 127
I try that and didnt work :( here is I try to do. Have you got any other ideas?

Your help is well appreciated.

Thank you


Code:

{foreach from=$items item=entry}
{assign var='tmp' value='Bottom News'}
{if $entry->fields.$tmp}
{$entry->title|cms_escape}</h3>
  {foreach from=$entry->fields item='field'}
        {if $field->type == 'file'}
    <img src="{$entry->file_location}/{$field->value}"  height="229" alt="{$field->name}" />
        {/if}
  {/foreach}
      {eval var=$entry->summary}

 {$entry->morelink moretext="Read More"}
{/if}
{/foreach}



Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Tue Jun 26, 2012 11:18 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 872
Location: London
Try using an underscore i.e. Bottom_News


Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Wed Jun 27, 2012 12:26 am 
Offline
Forum Members
Forum Members

Joined: Fri Nov 28, 2008 10:28 pm
Posts: 127
I could use that,but I want to look professional not looking bad for the user adding new news.

Anyone got this to work?

Cheers


Last edited by andrewvideo on Wed Jun 27, 2012 7:51 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Wed Jun 27, 2012 12:33 am 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 872
Location: London
I mean in the backend code not the field definition as that is how it used to work.


Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Wed Jun 27, 2012 7:43 am 
Offline
Forum Members
Forum Members

Joined: Fri Nov 28, 2008 10:28 pm
Posts: 127
This is why I am trying to do this so the field name look right in the backend. There most be a way to do this. lol

Cheers


Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Wed Jun 27, 2012 12:30 pm 
Offline
Forum Members
Forum Members

Joined: Fri Nov 28, 2008 10:28 pm
Posts: 127
Anyone know how to do this? Lol


Top
 Profile  
 
 Post subject: Re: News with Field Definition
PostPosted: Wed Jun 27, 2012 1:40 pm 
Offline
Forum Members
Forum Members

Joined: Fri Nov 28, 2008 10:28 pm
Posts: 127
I found a way round it by editing the editarticle.tpl in the News Module.


Here what I used but I don't really want be hacking CMSMS News Module.

Code:

{if isset($custom_fields)}
{foreach from=$custom_fields item='field'}
        <div class="pageoverflow">
           <p class="pagetext">{if $field->prompt == "leftfrontpage"} Left Frontpage {elseif $field->prompt == "rightfrontpage"} Right Frontpage {else} {$field->prompt}{/if}</p>
           <p class="pageinput">{$field->field}</p>
        </div>
{/foreach}
{/if}



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: stefhoesli


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner