Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
If/else: xfield

 
Reply to topic    Forum Index » Help View previous topic
View next topic
If/else: xfield
Author Message
mikeD



Joined: 02 Jan 2008
Posts: 27

Post If/else: xfield Reply with quote
Hello,

I'm no programmer so I need some help with this...

I have set up an optional xfield for links to external websites with news story. I have this in my active news template:
Code:
[xfgiven_storylink]<a href="[xfvalue_storylink]" target="_blank"  class="NewsLinks">{title}</a>[/xfgiven_storylink]
<a href="{link=home/post}" class="NewsLinks">{title}</a>

This of course shows the title twice. I'd like to only show the xfield (linked title to external website) if the editor has entered one. And if not, then it will display the default news title with link to internal news story.

Can this be done with if/else? Again, I'm no programmer, so if someone can show me exactly how to do this, it would be greatly appreciated.

Thanks.

_________________
Take a penny, leave a penny.
Sun Jul 13, 2008 1:53 pm View user's profile Send private message
Guest








Please login to hide the ads.

mikeD



Joined: 02 Jan 2008
Posts: 27

Post Reply with quote
Help.. anyone?

_________________
Take a penny, leave a penny.
Wed Jul 16, 2008 12:44 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
I edited the XField plugin to support [xfnotgiven_myxfield]Whatever[/xfnotgiven_myxfield].

Please re-download it with the main CNR download.
Fri Jul 18, 2008 10:37 am View user's profile Send private message
mikeD



Joined: 02 Jan 2008
Posts: 27

Post Reply with quote
Many thanks FI-DD.

I just replaced my xfield plugins with the new ones and gave it a go.

Here is what I have in my active news template now:
Code:
[xfgiven_storylink]<a href="[xfvalue_storylink]" target="_blank"  class="NewsLinks">{title}</a>[/xfgiven_storylink]
[xfnotgiven_storylink]<a href="{link=home/post}" class="NewsLinks">{title}</a>[/xfnotgiven_storylink]


It now works for news items that DO have an xfield option entered but it is NOT showing my normal news title/link for items that have not been given an xfield option. Any ideas? Am I using the tags correctly?

_________________
Take a penny, leave a penny.
Fri Jul 18, 2008 12:18 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Fixed a little bug. Please try again.
Fri Jul 18, 2008 3:07 pm View user's profile Send private message
mikeD



Joined: 02 Jan 2008
Posts: 27

Post SOLVED Reply with quote
That did it!
Again, many thanks FI-DD. You're awesome!

_________________
Take a penny, leave a penny.
Fri Jul 18, 2008 3:15 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.