How To Create custom plugin field for flexi content

More
11 years 3 months ago #39185 by foyougilles
hi,
I'm new to FLEXIcontent for joomla 2.5. and I have a little problem.

In fact, I would like to know where to find a tutorial for creating plugin FLEXIcontent.
to be precise, I would like to create a version of the plugin "relation", but, I want that in the front end, the filed showns only items posted by the current user.

For example, I have a category called FLEXI with contennant articles posted by user1, user2 and user3. I want if user1 logs in and accesses the submission form item that the field "relation" only shows items sent by User1.

Thank you for your help, I hope I'm clear enough.
Sorry for my bad English "googletrad!"!

Kaaah méééhhh Haah Mééhh Haaaaaaaaaaaaa

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #39188 by ggppdk
Hello,

It is better to avoid duplicating an existing field for minor changes, since you will be missing new features

what you ask can be done without duplciating the field type, but if want to duplicate the field type then please see this FAQ article for duplicating an exist field type:

How to Duplicate a Flexicontent Field to create a new Field Type

-- After creating a new custom field type "myrelation", then edit your existing field e.g. field15 and set it's type to be of field type "myrelation" instead of "relation"

NOTE: about custom coding on the new field type, this will require time on your part
[/list]

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #39189 by foyougilles
OK, I could not have imagined such a quick response. thank you.
since I'm new, and before I started the creation of a field "myrelation" (which will take me much longer I guess)
How can I do so without creating new field, with the current plugin "relation"?

Kaaah méééhhh Haah Mééhh Haaaaaaaaaaaaa

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #39190 by ggppdk
Hello,
this is interesting/useful and is trivial to add

-- you can download latest version of relation field from here:
code.google.com/p/flexicontent/s ... 2Frelation

Click on each file, then click view "raw file" and save it on disk)
files:
en-GB.plg_flexicontent_fields_relation.ini
relation.php
relation.xml


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #39191 by foyougilles
if i don't make a mistake, i should modify this in relation.php line 215


$query = "SELECT i.title, i.id, i.catid, i.state, GROUP_CONCAT(rel.catid SEPARATOR ',') as catlist, i.alias FROM #__content AS i "
. (($samelangonly || $method_types>1) ? " LEFT JOIN #__flexicontent_items_ext AS ie on i.id=ie.item_id " : "")
. ' LEFT JOIN #__flexicontent_cats_item_relations AS rel on i.id=rel.itemid '
. ' LEFT JOIN #__users AS u ON u.id = i.created_by'
. $where
. " GROUP BY rel.itemid "
. $orderby
;

but i don't know how ton continue

Kaaah méééhhh Haah Mééhh Haaaaaaaaaaaaa

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #39192 by ggppdk
Hello,

please do not modify any files,

just download files and backup/replace the originals files of relation field

otherwise you can wait for next public downloadable package


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.325 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline