XFields Forum Area

Post your suggestions for the script here.

Xfield

Postby marcelvk » Sat Oct 04, 2008 9:52 am

I have this in my template:
Code: Select all
<?php echo file_get_contents ("http://www.mywebsite.nl/cnr/mygallery/gallery.inc.php?mggal=[xfvalue_VALUE]"); ?>

And it works like charm i don't have to put in the whole code in to the post i just have to put in a number when i ad a gallery.
But what i would love is something like PJR is asking

but I'd like to put some function (yes the ajax rating) to only some post. I think using XFields is the best way, isn't it?

Example:
Code: Select all
[xfgiven_VALUE]
<?php echo file_get_contents ("http://www.mywebsite.nl/cnr/mygallery/gallery.inc.php?mggal=[xfvalue_VALUE]"); ?>
[/xfgiven_VALUE]


So i can turn in the gallery in a story... could someone help us?
marcelvk
 
Posts: 29
Joined: Thu Jun 19, 2008 10:10 pm

KICK

Postby marcelvk » Mon Oct 06, 2008 4:18 pm

KICK :D
marcelvk
 
Posts: 29
Joined: Thu Jun 19, 2008 10:10 pm

Postby FI-DD » Thu Oct 09, 2008 5:45 pm

What about creating a second XField called "show_gallery"?

Make it optional. If you put something in it will show the gallery. If you leave it empty it won't show the gallery.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby jino » Wed Feb 11, 2009 8:16 pm

Hi Scott,
i used Xfields (and templates) to make cuteNews.RU multi-language!

I just create three Xfields (title, short-story, full-story) and a template for each language.
Then i have slightly modified the javascript validation (to allow an empty short story) and config.php and the trick was done!

If someone is interested, as soon as i have a little time i explain this step by step.
jino
 
Posts: 7
Joined: Wed Nov 12, 2008 12:35 am

Postby svennis » Fri Nov 06, 2009 8:41 am

hiya,
jino could u please tell more about that?

tnx
svennis
 
Posts: 94
Joined: Mon Oct 09, 2006 2:54 pm

Postby DarkSlim » Fri Nov 06, 2009 8:58 am

svennis wrote:hiya,
jino could u please tell more about that?

tnx


He added 3 new x-fields for each language he wanted to add
1 for title, 1 for short story and 1 for full-story
(for example new xfields for french language will be like: titlefrench, shortfrench, fullfrench)
And like that when adding a story you have multiple fields for titles, short stories and full stories
each one for each language, and in the template you can choose to show the wanted
language fields each time, you can also show more than one language too :)
User avatar
DarkSlim
 
Posts: 296
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Postby Goberg » Wed Feb 24, 2010 1:42 am

scottdallas wrote:2.

xfield name: target

Description: How would you like your full story hyperlink to react?



Drop Down



Values to add:

_top

_blank



How to use in template:

I use this in conjunction with the previous xfield I mentioned (fullstoryurl). Now all together you can put this in your template to give you more control of how your links react: <a href="[xfvalue_fullstoryurl]" target="[xfvalue_target]">{title}</a> and/or <a href="[xfvalue_fullstory]" target="[xfvalue_target]">{avatar}</a>



Usage and practicality:

I added this in an effort so as not to lose my traffic. If I am sending a person to an offsite link, by default it's going to load in the same window.. most the time you want that like if you're just sending the person to your full-story (that's why I add it first so this is the default value selected). If you ignore this field it will automatically fill it in with _top. If you are sending the person to an off site link then select _blank and it will open in a new window and they will remain at your page. This is great for media sites.. especially when you don't want to be hosting all the media yourself and posting it in the full story, or hotlinking other peoples media (makes people angry apparently lol), or putting the link to the off site material in the full story (makes the person have to click twice instead of getting the juicy contents right from the main page).

- - - - - - - - - - - - - - - - -


One nice way of using cutenews and xfields with lightbox is to just use the REL value like you have done with TARGET here Scott. Very easy way to set up a gallery or something.
Goberg
 
Posts: 79
Joined: Thu Jan 18, 2007 2:31 pm

Postby haverica » Tue Apr 06, 2010 7:24 am

Can anybody show me on an example how this xfields works. I sow same links here with the examples, but links are broken. Call me stupid or whatever but I just seems not to understand how it works and what is this xfields at all. I have some toughts about it. I would appriciate if someone can show me an example with the link.

Thank you very much,

O.
haverica
 
Posts: 13
Joined: Wed Dec 03, 2008 12:07 pm

Postby DarkSlim » Wed Apr 07, 2010 2:31 pm

haverica wrote:Can anybody show me on an example how this xfields works. I sow same links here with the examples, but links are broken. Call me stupid or whatever but I just seems not to understand how it works and what is this xfields at all. I have some toughts about it. I would appriciate if someone can show me an example with the link.

Thank you very much,

O.


Check: you-website.com/path/to/cnr/index.php?mod=help

* ofcource change to your websites url and the path to cutenewsru :)

There is a part with info about XFields and more info.

Also, here is a quote:
Understanding XFields

With XFields, you can add custom fields to your CuteNews installation. These fields are like "Title", "Avatar URL", "Short Story" and "Full Story". You might say: "So, why is this addon so powerfull?". Well with this addon, CuteNews will be even more flexible.

For example: For a clan site, you need an page where all matches are displayed on. You might want to do this with CuteNews. Your table always need the same layout, so make XFields and use them in your templates. Now you can just make fields for "Enemy", "Server IP", etc.

Another example: If you're writing news posts about new games released, you could have a default place for screenshots, but don't want to put the HTML code in your news post everytime, you could use XFields. You might just put the screenshot code in your templates, and in your following news posts, just fill in the XField for the screenshot with the filename and it will show up as you did before, but a lot easier.

Final example: If you have a site, made in two languages and you just want to use one CuteNews news post in two languages, you could use XFields. Just make one or two multiline XFields and an title XField. Now use them in diffrent templates. In your site just use the diffrent templates, and you will get the posts in the proper language.

This addon was made by SMKiller2.

Creating and editing XFields

These are the fields that should be filled in when you edit or add a XField:

Name: The internal name the XField should use. This should be unique for each XField and is not displayed anywhere.

Description:
The description showed when adding or editing news.

Category:
Select the category of the news item where the XField should appear. If you select custom, another field appears where you can select multiple categories.

Type:
Select the behavoir of the XField. You can shoose between three diffrent types.

Default: You will only get this field when you have selected either "Multi Line" or "Single Line" as type. You may enter a default value for the XField here.

Options: You will only get this field when you have selected "Dropdown Listbox" as type. You may enter all options that should appear in this field here. You cannot use two exacly the same options.

Optional:
You will only get this checkbox when you have selected either "Multi Line" or "Single Line" as type. You can select whether the field is optional or not here.


Configuring Templates

You can use the values entered in the XFields in your templates, just use the following tags:

[xfvalue_NAME]: This will output the XField with the same name as provided in the tag as NAME.

eg. My current mood is: &quot;[xfvalue_mood]&quot;.
Will display: My current mood is: "happy". When you entered it in the XField. But note that if the XField is optional and you haven't entered a value, it will show: My current mood is: "".

[xfgiven_NAME]...[/xfgiven_NAME]:
This is only supported for optional XFields. It will only show the code between the tags if the XField is filled with a value. Otherwise it won't show anything.

[xfnotgiven_NAME]...[/xfnotgiven_NAME]: This is only supported for optional XFields. It will only show the code between the tags if the XField is empty. Otherwise it won't show anything.

eg. [xfgiven_mood] My current mood is: &quot;[xfvalue_mood]&quot;. [/xfgiven_mood][xfnotgiven_mood]No mood today.[/xfnotgiven_mood]
Will display: My current mood is: "happy". When you entered "happy" in the XField. If you haven't entered anything in the XField, it will show "No mood today.".
User avatar
DarkSlim
 
Posts: 296
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Re: XFields Forum Area

Postby bigpig » Wed Apr 20, 2011 8:36 am

I guess I'm the only one that got that excited over Xfields. *wallows away in own self pity* lol jk :P Well, then I won't share any of my cool xfields with you peoples.
bigpig
 
Posts: 3
Joined: Wed Apr 20, 2011 8:30 am

Previous

Return to Suggestions



Who is online

Users browsing this forum: No registered users and 0 guests