Menu Item Type for My Component com_mycom in Joomla - joomla

I want to add a Menu Item Type for my component.
Have a look at this picture:
How can I add my component to it and add menus to it, so that when a user clicks upon them, they get added at frontEnd.

In order to create new menu item types for your component, you have to create a new xml file. To put it simple, if you want to create a new menu item type for your view "myview" and the layout "default" in you component, usually you have to create a new xml file named "default.xml" inside the folder "/components/com_mycom/views/myview/tmpl" (note the xml file has to be created in the frontend part of the component, not in the administrator).
You can take a look at other xml files, for example com_content/views/article/tmpl
I hope it helps!

Related

Add record with ID, selecting NAME from another table

Can anyone, please, help me with Libreoffice Base form creation?
I have the following tables:
And I'm trying to add a form to enter new RESOURCES record with the following fields: [RESOURCE_NAME], [CURRENCY_NAME] and [AMOUNT]. But after 10+ tries I have not succeeded. I have tried adding it via wizard, selecting RESOURCES as main form and CURRENCIES as subform and vice versa. I have tried VIEWS and forms based on them. These tries only gave to me or no possibility to enter new record, either creation of the new CURRENCY.
I don't need to create new currency via this form, I only want to enter new Resource (only enter once, not to modify, not to delete). Since I don't want to remember all the ID's I want to select currency name via DropDown list.
Can anyone provide instructions about how to do it, please?
Thanks.
You do not need a subform for this - just create your form document with RESOURCES as the main form (only form).
You will need a listbox to enter the currency item. A listbox has two fields, a display field and a field that is saved in the table. You will set it up to display CURRENCY_NAME and store CURRENCY_ID.
When you create a listbox, the wizard that pops up may get you what you want. If the wizard falls short:
Make sure the form document is open in design mode: on the "Form Controls" toolbar, the leftmost/topmost icon of a pencil with a triangle should be depressed. If this icon is grayed out, close your document, right-click on its name and choose "Edit".
Right-click on the listbox and choose "Control"; this will open the properties window
On the tab "Data" change the "Type of list contents" to "Sql"
In the field "List content" enter SELECT "CURRENCY_NAME", "CURRENCY_ID" FROM "CURRENCIES" ORDER BY "CURRENCY_NAME"
The Bound Field should default to 1. If it isn't 1, change it to 1.
Close the properties window and save your form. It should work as you want now.
If you want a listbox inside a tablegrid: after you create the table, with the form in edit mode, right-click on the column name you want to change and choose "Replace with" and then "listbox".
Edited to include comment by OP about bound field needing to be 1

Adempiere - How to design/call CreateLinesFrom button in window

I want to create CreateLineFrom form in my custom window/Table in WEBUI.
I have created CreateFrom field in my custom table and window level.
So is there any java code changes needed ?
Its already exists in Material Receipt standard window, now i want to do same thing in my custom window, so where i have to modify.
Write a process - there are lots of examples in the the org.compiere.process of the "base" module.
Create a new Process in the Application Dictionary and point it to your newly written process created in step 1.
Add a new column of reference type button to the table underlying the Window/Tab you'd like the button on and point this your new process by selecting the Process from the drop-down.
Finally add the new column created to the Windows/Tab were you need it to appear.

Creating Custom List Definition using VS 2010 without creating Custom Content type

I want to create Custom List Definition without creating custom content type. Way I followed is created farm solution without list instance -> In the elements.xml file I gave 10005 as a type and in the Schema.XML in the section I added custom fields and also in the default view as well. When I deployed this project and created list based on this definition and clicked on the "New Item" it didnt show Custom Columns but only the Title Column. To solve this I removed whole content type section from the Schema.XMl and deployed the solution again. I created list based on the List definition this time clicking on the "New Item" link in the list view it shows all the custom columns but when I go to ribbon and click on the "New Item" drop down it does not show "New Item" but it shows the name of the list instead and also it adds the name of the list as a content type. I can understand this behaviour as I removed content type section from the Schema.XML but how can I add custom columns to Item Content type ?
In the Schema.xml file you need to:
Declare the fields inside the Fields node (the same way you would if you were creating site columns)
Update the default view to show the newly created fields (if necessary)
Delete the ContentTypes node
I cover this in detail in the Creating Lists using CAML module of my Pluralsight SharePoint 2010 Lists and Libraries for Developers course. You could watch it using a trial subscription.

How do I create an editable field with a Save button on Magento Admin's Order detail page?

I've already created a custom module that overrides the sales/order/view/tab/info.phtml layout file and creates a new field in the sales_flat_order table. Now I need figure out how to add a text input field to the order page:
The save button doesn't necessarily need to be right near the custom field and the field doesn't need to necessarily appear right where I put it in the graphic. Bottom line is, the administrator needs to be able to edit my new custom field in the admin.
What is the best way to do that?
Look at Comments History block
implementation - class Mage_Adminhtml_Block_Sales_Order_View_History, its template \app\design\adminhtml\default\default\template\sales\order\view\history.phtml and Mage_Adminhtml_Sales_OrderController::addCommentAction(). You should create similar block class with similar template and create controller with action which will save form data to your db field.

show joomla component in menu item type

I made a component for Joomla and it's working ok with the direct url: http://www.something.com/index.php?option=com_pbform
The problem is that when I try to add it in the menu.
When I change the menu item type, the component is listed, but when I click on it I don't get a view to apply to the menu item.
Do I have to configure anything else in the component?
Thank you!
Add your component to jos_components table:
INSERT INTO jos_components (name, link, admin_menu_link, `option`)
VALUES (
'Greetings', 'option=com_greetings', 'option=com_greetings', 'com_greetings')
If you have all your views set up correctly you need to add your component into the Joomla database.
Functions and view folders must have no hyphens or underscores.
Good
/view/viewone
/view/viewtwo
/view/viewthree
Bad
/view/view_one
/view/view_two
/view/view_three
If you setup your component in the MVC fashion then you would have a views/layout folder structure in your component folder. Each different view you have in there will be listed in the menu types under your component name. This is where the views can be chosen.
For e.g. in your component folder structure you have
views/view_a
views/view_b
views/view_c
then in the Joomla menu selector you would have those choices to select as a view.
If you haven't setup your component as MVC then have a look at this tutorial on how to do just that http://www.joomladevuser.com/tutorials/components
I hope that helps!
Cheers
You may need a metadata.xml file for each of your views. See http://docs.joomla.org/Adding_view_layout_configuration_parameters for more details
Use this simple solution. You expected to find your new component in the menu item type drop-down list, but its not there! Instead of trying to cope with that ugly MVC scrap do this:
select "single article" from the list and SAVE your new menu item
now open your joomla db
select _menu table
edit your menu row
change link from article to index.php?option=com_yourcomponent
save and take a look at administrator menu manager
I did migrate my Joomla 1.5 collection of Ajax/PHP scripts to Joomla 1.7.3 using this solution in just one day.
Piece of cake.

Resources