Canceling saving of an item via onBeforeSaveField function

More
13 years 1 month ago #25210 by yaK2manD
Hello,

I would like to know if it is possible to execute a php script on submission in order to check a field and to fill in another field before saving data.

For example, I have a field "link".
When a user wants to save the content, the script checks the link and extract the main website and store it into a field (hidden to normal users) "website".
Another feature would be : if the website has already been saved by someone else, it isn't save the link and returns an error message.

Thank you very much.

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

More
13 years 1 month ago #25215 by ggppdk
FLEXIcontent fields are joomla plugins and the have a function that is called before a field value is saved named onBeforeSaveFieldValue(), you will need to duplicate the field (see our FAQ article) and alter this function.

You will need to have PHP/mysql and Joomla programming knowledge in order to do this.

flexicontent.org/documentation/f ... ields.html

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
13 years 1 month ago #25230 by yaK2manD
Ok. thank you for your answer.
But, if the script is not successful, can I make it returned an error message in the frontend submission ?

I have another question, you can have content in different languages but can a user select different languages in order to filter content in a category ?

For example, I have alpha in english, beta in french, zeta in spanish in the category gamma.
A user would like just to see alpha and beta (filter through 2 languages).
Is it possible ?


Thank you.

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

More
13 years 1 month ago #25232 by igcorreia
We have the same issue, but not with languagues our problem is with color.

For example I have an extra field called colors it is a SELECT MULTIPLE so the user can say that a t-shirts has black, yellow and red in it. The same can be applies with the CHECKBOX FIELD, this means that an ITEM can have MULTIPLE values assign to it, rigth?

but the filter in FC is always select so the user can only filter one VALUE at a TIME, the never can ser the T-SHIRTS that are YELLOW "AND" BLACK.

Something like this would be nice on a PER FC FIELD we could have a param that we could set:

Filter as SELECT or Filter as ChechBoxes

and in the front end the user could check the values.

Check this example:
www.zillow.com/homes/for_sale/

in the filters the houses are CHECKBOXES.

the query string should be something like:

www.yoursite.com/t-shirts?color=1&color=2

Probably this is a bug change in the fields, templates and views.

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

More
13 years 1 month ago #25234 by yaK2manD
It is exactly the issue.

Checkboxes as a filter mode.



ggppdk wrote: FLEXIcontent fields are joomla plugins and the have a function that is called before a field value is saved named onBeforeSaveFieldValue(), you will need to duplicate the field (see our FAQ article) and alter this function.

You will need to have PHP/mysql and Joomla programming knowledge in order to do this.

flexicontent.org/documentation/f ... ields.html

Regards


Can I fill in other fields through this method ?

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

More
13 years 1 month ago #25238 by ggppdk
To pass an error notice to the frontend you could use:
Code:
if ($ihavefailed) { $jAp=& JFactory::getApplication(); $jAp->enqueueMessage("my error message", 'notice'); }

About the filtering being multi-value and also supporting checkboxes we have an enhancement issue open:
code.google.com/p/flexicontent/i ... ail?id=391


-- 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.344 seconds
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
Save