Create new page for component's element in joomla - joomla

I have a problem with joomla. I'm trying to create my fisrt joomla component starting from nothing. I've already been able to create the table mysql, the page form (in the administration section) e the module whose function is print the complete list of the elements.
Anyway I don't get how to create a new page for each element and how to get the dinamic adress.
can you help me to solve this problem by writing me some guide links?

If you're new to MVC and Joomla, I'd strongly recommend using Component Creator. The free registration lets you create a component with a single table, and it's very fast and easy. Download the built component and install it, then you can see the parts and pieces you need to make all the magic happen.

Related

How to build a simple form in CQ5

I have started a new AEM project in eclipse that has
core
launcher
tests
ui.apps
ui.content
I have a local instance of 5.6.1 running and I would like to create a very simple form (firstname, lastname) and have it persist data such that I can view data for all forms submitted. Also, I would like for the form to be approve/rejected (e.g. user1 submits the form, user2 accepts/rejects it).
I'm new to AEM and have been looking at docs and trying to find a tutorial for it for a while now but haven't been successful.
Question
Can someone please walk me through how to accomplish this simple form? Once I can do this I can build-up more functionality on my own.
What I've tried
I tried to create a form in the Geometrixx Media site but I don't see form template there.
I also tried following this tutorial but it didn't help since its for 6.0 and is confusing to the point that I don't follow it at all.
You need some basic understanding of how cq/aem works in order to accomplish the task you started. But in the simplest use case, you need the following things:
You can create new cq page component and define in the jsp the html markup of the form you need
Or you can build a page/component using the /libs/foundation/components/form components. Start reading the best from the page developing forms.
The form action can point to the component itself where you can store the data (if you create a page with a component who is responsible for rendering the form) and in this case you can let sling post processor to handle the data storage or you can define your own action with a servlet where you can create a node on your desired location.
The second part of you question is about approving/rejecting submitted data. I guess, that you are talking about workflows. Every time the form is submitted you have to create a new node (or let sling to create it) and than start a workflow for moderating the content. You use here as example the implementation of the social comments and the moderation workflow.

creating a simple settings form in joomla 2.5 with JForm

I am newbie to joomla! component programming. i am creating a MVC component that users can reserve some dates.
my component should have a simple settings view that admin can manage the component.
i used some references but i have problem to create this settings view and it doesn't work.
to do this, i created a #__mycomponent_settings table and a row that holds settings data and also added these files:
com_mycomponent/controllers/settings.php
com_mycomponent/models/settings.php
com_mycomponent/models/forms/settings.xml
com_mycomponent/tables/settings.php
com_mycomponent/views/settings/view.html.php
com_mycomponent/views/settings/tmpl/default.php
I defined my fields in the xml file and loaded them to the view correctly, but the real problem that confuses me is i really don't know how to use JForm and JTable correctly to submit and save data in the database or to retrieve previously saved data and put them into the fields. or how i should use JToolbarHelper to submit data or what must be entered in the action attribute of the form. i used save button of JToolbarHelper but it takes me to the
com_mycomponent&view=settings&layout=edit
but i didn't define any edit layout everywhere in me code!
i get so confused and will be appreciated if you help me.
I'd strongly suggest using native joomla settings logic, instead of storing them on database.
You can read more about it here http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_configuration (read only the Adding configuration parameters part
If you have more questions implementing it, I'll be happy yo help.

customizing componnet in joomla

i have created a component using this http://www.notwebdesign.com/joomla-component-creator/index.php component creator how can i add a simple registration form in that and also make its backend looks like the other component
The name of that utility is a little misleading since it only creates the structure of a component. If you want to add functionality to the structure created you will need to actually put in the code that does what ever you need it to do. Think of this as the foundation and framework of a house. You actually have to put the walls up and furnish it.
It would probably be helpful to understand the files that have been created for you so you know what needs to be added. I would recommend learning how to build a component from scratch first. Joomla has pretty good documentation on that here - http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
i have develop the Lots of component from this site http://www.notwebdesign.com/joomla-component-creator/index.php .
1) First Create the components and give the name and crrate the require field fo the registration from .and save the components then after the download this components.
2) Install the components in your joomla site.
3) Go to the Fornt-end view components folder. and create a form in the default.php page and save and update operation query is written in the model .
Your Registration page is ready.
This tutorial is the best I have come across so far. It will hopefully guide you to understand the MVC structure that the component generating site delivers to you.
I am actually the developer of the Component Creator you have used. It only creates the MVC files and structures needed to quickly create a component. You still need quite good PHP skills to develop a fully working component.
The component creator helps developers with the tedious tasks of building the framework.

Dependent Dropdown inside Joomla

I was trying to implement the Ajax method for deploying dependent drop down select boxes inside Joomla. The Problem is that if you call an ajaxRequest to run a php with the query that populates the second drop down depending on the result of the first, this is out of the joomla framework and you can't use anything from the joomla functions.
So I need to copy into the new file all the details of my dbase login + to write down the html+php to populate the options. I was thinking whether there is an easier solution to this problem. Maybe the Joomla framework supports something like this.
Any ideas?
I think you create a view /ajax/
http://mysite.com/index.php?option=com_mycomponent&view=ajax&format=raw

How to create my own form in joomla

I want to create my own form that are submitted and values of that form will be stored in joomla database. How can i used the Joomla connection code to interacte with the joomla database.
If you just want to get your work done, there are some components already avaiable in Joomla Extension's website to your form's needs. CkForms is a good one, you can create simple forms with it that are automatically saved in the database (supports upload of files too).
If you want to learn how to write extensions in Joomla, you should read Joomla Official Documentation website.
Extensions in Joomla are divided in "Components", "Modules" and "Plugins". More informations about these differences can be found here and here.
What you're trying to achieve sounds a "component" to me. Downloading the CkForms and reading it's source code should get you started to Joomla's way of writing components.
EDIT: Joomla has a huge API with a lot of features. It has a database module of it's own, with insert methods and such. Reading Joomla's API website before implementing your component it's a good idea to avoid "reinventing the wheel" and it's a good practice since those methods are extensively tested by all Joomla users.
The JForm class helps you build forms.
Documentation can be found here:
joomla CMS: http://docs.joomla.org/API16:JForm
joomla API: http://api.joomla.org/11.4/Joomla-Platform/Form/JForm.html
This class provides you with ready to use form elements and form loading and/or processing methods
This class includes validation methods, date picker control, color picker, etc.
Of course, as another mentioned above, if you are building a module, component, or application, you will need to learn how to to develop a module, component or application. Of these three, the module is the easiest to implement.
The application gives you much freedom b/c you are not constrained to the CMS paradigm, front and back end complexities. However, there is little documentation about how to develop applications with Joomla framework b/c joomla as a framework is relatively new
This tutorial gets you started understanding how to use JForm to create a form in Joomla: http://www.ostraining.com/blog/how-tos/development/getting-started-with-jform/
Or you could just create add a html module to any position and then write the form in html i.e.
<form method="post" action="mycreatedpage.php"> <input type="text"/> <input type="submit">
Now just create a page that handles the code by emailing or inserting into db. I havent tried it but i think it should work.
Looks like everyone already told you almost everything I know except for the component creator. Very easy to use, and it follows Joomla standards. Will get you up and running within minutes.
I have got good working experience with Joomla RSForm Pro. It has got options for
validation
user email/admin emails on submit
file uploads
and many more
Good tutorials too. Get started with http://www.rsjoomla.com/support/documentation/view-knowledgebase/21-rsform-pro.html
Good luck!
Create View.
Create Model.
Create Table.
Create Controller ( if Needed ).
Create Form xml file.
Go here for more information:
http://docs.joomla.org/Standard_form_field_types
Take a look at the Chronoforms extension - does more than you want.
You have two options:
Use an already built custom form extension
Create your own custom form extension (or outsource it)
Now if you only want to modify the user registration form, then you can do some PHP customization to accomplish your goal.
Making forms in Joomla can be done in a couple of ways.
If you just wanted a contact us, you can just create a page with a menu item for the User contact form. This gives you a page with a Members address and contact form. So all you would need to do was add the user as the company of the websites home address and email. But the form is very basic, name, title, textarea for message.
Next up from that you could just make a Custom HTML module add add a form to it in plain HTML like +Sean said above this, you would need to code in PHP your own form process script. You would not get error in form data checking unless you also wrote it.
Next you might rather look on the Joomla Extension Directory JED for one of the good extensions for 3 and 2.5 Joomla RSForms!Pro is good, and can do all we have needed. This lets you add fields one by one and move your form around. Then can auto generate or custom the html of the form.
You can easily create your own forms with Fabrik
Chronoforms are now a days a very popular solution for custom forms in joomla. Chornoforms support twitter bootstrap also. In simple 5 steps you can create a contact form with unlimited fields and also embed various function like DB save, Email, Thanks Message, Redirection on any page. There is events and events will have particular events.
Also possibility of extension of Normal joomla registeration. It will not extend the core registration but at the time of registration you can take various information from users.
I would use Chrono Forms, they work really well and are easy to use.
Download here
Here is a full tutorial on the new Chronoforms 5 to help you get started quickly and understand most of the features available.
CLICK HERE
You can use plugin to insert external php form in content. It is easy and you don't need to make plugin etc. Please use this.
I suggest you to use breezingforms: http://crosstec.de/en/extensions/joomla-forms-download.html
It's one of the best solutions for custom form creation in joomla.

Resources