1 tilqicom Jun 22, 2010 16:41
3 sam2kb Jun 24, 2010 02:36
I have an Extra Fields plugin too :roll: it adds custom item/blog fields. It was never released.
You will have to manually add the fields in plugin code, you'll figure it out ;)
[url=http://www.sonorth.com/travel/download/977G3VJJ82]Get it[/url]
4 tilqicom Jun 24, 2010 08:32
sam2kb wrote:
I have an Extra Fields plugin too :roll: it adds custom item/blog fields. It was never released.
You will have to manually add the fields in plugin code, you'll figure it out ;)[url=http://www.sonorth.com/travel/download/977G3VJJ82]Get it[/url]
Yep, that looks quite the thing i need, but the values i typed in does not show up in front end...How do i call em ?
5 sam2kb Jun 25, 2010 05:12
It seems like I forgot to code the frontend to this plugin :)
Anyway, you can pull the values with this method
$xtraFields = $Plugins->get_by_code('xtraFields');
$my_var = $xtraFields->get_field( 'field_name', 'blog', 44 );
'field_name' - unique field name you defined in config
'blog' - target object type, either "blog" or "item"
44 - object ID
Example: get item fields
$my_var = $xtraFields->get_field( 'field_name', 'item', $Item->ID );
Example: get blog fields
$my_var = $xtraFields->get_field( 'field_name', 'blog', $Blog->ID );
6 tilqicom Jun 25, 2010 11:58
Thank you.. seems like just what i need but i ve put this
<?php $my_var = $xtraFields->get_field( 'recip_url', 'item', $Item->ID ); ?>
inside content but nothing displays, and the loop gets cut off
7 sam2kb Jun 25, 2010 18:19
Make sure you didn't forget about this. You should also check the box in plugin settings in order to enable item/blog fields.
global $Plugins;
$xtraFields = $Plugins->get_by_code('xtraFields');
// uncomment to see if plugin is enabled and working good
// var_export($xtraFields);
while (Item loop)
{
$my_var = $xtraFields->get_field( 'recip_url', 'item', $Item->ID );
echo $my_var;
}
8 yabba Jun 25, 2010 18:44
[offtopic]
in your plugin, you can use
if( is_a( $obj, 'Item' )
{
// foo
}
elseif( is_a( $obj, 'Blog') )
{
// bar
}
else
{
// bugger
}
And remove your object_type param requirement
[/offtopic]
¥
9 sam2kb Jun 25, 2010 18:50
Thanks for the tip :)
10 yabba Jun 25, 2010 18:51
No worries, I use it in another plugin and it just makes shit easier for the user ;)
Note, final param needs to be $Item||$Blog not ++ ->ID
¥
11 tilqicom Jun 28, 2010 10:27
/*edited my own post*/ seems to be working now.. further edit:
yep definitely working, and just what i needed..cant thank you enough, as if it wasn't enough that you are the only one around trying to maintain evo, (other than ¥åßßå -despite his departure-), and yet you keep coming up with exact solutions to my needs.. cheers, let me know if i can do anything for you to help back
12 sam2kb Jun 28, 2010 17:50
It's good to hear that one of my unreleased plugins is finally in use :)
13 johnnyeng Jul 12, 2010 23:41
Thank you! Thank you! Thank you!
Pretty sure it's a per post thing, have zero idea if it works in 3.anything.
Wouldn't be to hard to knock it around to suit your needs. Plugin post is here @link [url=http://b2evo-archived.waffleson.co.uk/2009/01/add-fields-to-your-posts]Add Fields To Your posts[/url] ... let me know if the download url is borked ;)
¥