 |
 |
 |
 |
 |
| Author |
Message |
mikeD
Joined: 02 Jan 2008 Posts: 27
|
|
If/else: xfield |
|
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:
 |  | [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 |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
mikeD
Joined: 02 Jan 2008 Posts: 27
|
|
|
|
Help.. anyone?
_________________ Take a penny, leave a penny. |
|
| Wed Jul 16, 2008 12:44 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
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 |
|
 |
mikeD
Joined: 02 Jan 2008 Posts: 27
|
|
|
|
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:
 |  | [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 |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Fixed a little bug. Please try again.
|
|
| Fri Jul 18, 2008 3:07 pm |
|
 |
mikeD
Joined: 02 Jan 2008 Posts: 27
|
|
SOLVED |
|
That did it!
Again, many thanks FI-DD. You're awesome!
_________________ Take a penny, leave a penny. |
|
| Fri Jul 18, 2008 3:15 pm |
|
 |
|
|
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
|
|
 |
 |
 |
|