By Vladimir Antropov on Thursday, 03 July 2014
Replies 26
Likes 0
Views 748
Votes 0
Hello,

I'd like to have a custom entry form instead of, or in addition to the standard Share what's new form. Is it possible to do in an upgrade-resistant manner, or do I have to hack ES code?

Regards,
Vlad
You can do anything you want in that trigger handler. If you have some specific custom fields data that you want to save and you have a database table for it, you could just save the data there. In the link app, it's just an example of storing links metadata into the database table.
·
Sunday, 20 July 2014 16:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Vladimir,

You should take a look at some of the apps like tasks app for groups on how you could actually extend the story form in the stream
·
Thursday, 03 July 2014 19:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

In fact, Tasks app was the first one I looked at It has an input form, but it appears on a separate canvas. How can it be modified, so that the form appears alongside, or instead of Share what's new form on the dashboard?
·
Thursday, 03 July 2014 19:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Vladimir,

If you are altering the default behavior, I am afraid the only way to go is to do this via template overrides
·
Thursday, 03 July 2014 23:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Correct me if I am wrong, Mark, but template overrides can only change the style. I tried to check documentation on Template Overrides, but only found this:
We apologize for the inconveniences caused. This section will be updated soon.


I need to change the structure of the form and the model behind this. I noticed that the entry form and the stream item processing code sit under Story app. Is it treated differently from other apps? I can change its code but then, I guess, I'll have to maintain it continuously with each new upgrade. Is there a simple way to make ES use some other app instead of Story?
·
Friday, 04 July 2014 07:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Vlad, im keen on this too, but mine is more on accessing it like you post on facebook.
http://stackideas.com/voices/easysocial/item/375

Keen to see what youre thinking.
·
Friday, 04 July 2014 17:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Vladimir,

If you need more extensive modifications, then I think just the theme files are not sufficient enough unfortunately You also need to modify the scripts and the models too .
·
Friday, 04 July 2014 17:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Ryan. You're right - it's not exactly what I have on my mind.

I wouldn't bug stackideas' guys with my questions if there were a few flowcharts which showed customisable ES components and how they fit into the execution flow and site structure. Currently, I am spending a lot of time plugging backtrace output into various files, trying to understand how all these parts hang together. Frustrating
·
Friday, 04 July 2014 17:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Vladimir,

It's actually pretty straight forward once you get the hang of it
·
Friday, 04 July 2014 19:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Yeah, just like Columbus's egg.
·
Friday, 04 July 2014 20:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Lol, yeah in a way :x In essence, always remember that all libraries in EasySocial are placed in /administrator/components/com_easysocial/includes/ and all models file for EasySocial are placed in /administrator/components/com_easysocial/models . The rest of them such as views, are pretty standard to Joomla's views
·
Saturday, 05 July 2014 01:34
·
0 Likes
·
0 Votes
·
0 Comments
·
OK, after some digging around I have found a way of adding my own set of fields to the entry form: onPrepareStoryPanel event handler. I believe this should survive minor version upgrades as it doesn't require changing any stackideas's code.

Next question is how can I send information from my custom fields in HTTP request along with all the standard stuff. Is there a naming convention or an interface that I can use for this purpose? Any advice, or at least, a reference to the right file will be highly appreciated
·
Sunday, 06 July 2014 18:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Vladimir,

I am really sorry for the delay of this reply as it is a weekend for us here. Hm, sorry but not really sure if I understand your question here. What do you mean by sending your custom fields in HTTP?
·
Monday, 07 July 2014 11:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

I found a way to add my custom fields to the entry form. Now I want to save them to the database. How can I ensure that those fields are transferred to the web server in HTTP request, when a user clicks Share button? Is there an interface or a naming convention I need to use for my fields?
·
Monday, 07 July 2014 17:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Vladimir,

You need to take a look at the existing codes on how you can attach additional data to the save object. You can take a look at the existing codes in /media/com_easysocial/scripts/story/links.js
·
Monday, 07 July 2014 19:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for the pointer, Mark; I can use that file as an example and create my own script. Next question will be: how can I load my own .js file with the HTML page without modifying your code?

It looks like all JavaScript files you need to load are listed in media/com_easysocial/scripts/easysocial-1.2.18.static.js. I can add my script to that file, but I wouldn't like to repeat this operation with each new version.
·
Monday, 07 July 2014 19:48
·
0 Likes
·
0 Votes
·
0 Comments
·
subscribe
·
Monday, 07 July 2014 23:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Vladimir,

If your theme file's name is test.php , just create a test.js EasySocial will be intelligent enough to locate for a .js file
·
Tuesday, 08 July 2014 01:36
·
0 Likes
·
0 Votes
·
0 Comments
·
I've got JS file sorted and should be able to send data from custom fields back to the server. Now I am trying to understand how this custom data can be processed in PHP. Taking media/com_easysocial/apps/user/links/links.php as an example I expected it to save link information in onAfterStorySave handler. That handler extracts link-related fields, but doesn't do much in the way of saving them to the database. Instead, there is storeLinks function, a call to which is hard-coded into SocialStory.create method.

I try to avoid touching ES core code, but that example confused me. Can someone confirm whether onAfterStorySave handler is the right method to process custom fields? If it is, why it's not used in Links app?
·
Saturday, 19 July 2014 15:45
·
0 Likes
·
0 Votes
·
0 Comments
·
I have successfully managed to create a custom entry form and an output screen using just app files. Thank you for your help, Mark.
·
Wednesday, 23 July 2014 21:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Congrats Vladimir on your success I'm curious, would you share with us, what method did you ultimately find satisfied the objective(s) of your app?
·
Wednesday, 23 July 2014 23:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Nice, thanks for sharing Vladimir
·
Thursday, 24 July 2014 12:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Eileen,

I did a lot of reverse engineering and tracing to find all the required files and commands which make the application work. Currently, it's just a proof of concept, so I don't have a comprehensive list of changes I made. Still have to find out how to customise edit and search forms.
·
Thursday, 24 July 2014 17:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating Vladimir. If you don't mind me asking, what are the essentials that were missing which you were trying to look for so that we could run an update on our docs (I know, our docs is not 100% updated but I hope that you bear with us)
·
Thursday, 24 July 2014 23:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

The biggest challenge was to understand how all those numerous files which comprised Links app hung together. What would really help is to have a table of all app files which describes a purpose of each file and where it is called or loaded. If a file is loaded by core ES code based on a naming convention or metadata stored in the DB, then it should also be described. Such detailed explanation will save a lot of time for anyone who writes his first app.
·
Sunday, 27 July 2014 09:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for the heads up on this Vladimir, appreciate it very much.
·
Sunday, 27 July 2014 12:43
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post