Joomla Component administration - link to different views - joomla

I have created a component in Joomla following the tutorial and I am using the MVC model. In the administration page, I can see everything from the default view but I don't know how to add a menu in there to access different views.
In the site it is easy as I link the menus to the different views but how can I achieve this in the administration part of the site?
When I click on the component in the admin part, I would like to have a menu to go to the different views. I could create links and a new menu myself but I hope there is something in Joomla to integrate this.
Thanks for the help.

In the installation xml file of your component you can add some code, whihc will automatically create some menus in Joomla Menu => components => yourComponent =>
<menu>COM_ABC</menu>
<submenu>
<menu view="config">COM_ABC_CONFIG</menu>
<menu view="view1">COM_ABC_VIEW1</menu>
<menu view="view2">COM_ABC_VIEW2</menu>
</submenu>
If you are using Joomla 3.x then you can render this menus in your screens also by rendering menu layout. Probably this function JHtmlSidebar::render(); can help you.

Related

How would I move from the default ASP.NET layout to another theme

I just started to use MVC for a simple website. Very new to this.
I am trying to change from the default layout to a simple layout page with sidebar navigation with drop-down list capability. Something similar to one that is shown in the enter link description here
Could you please guide me through this? I have downloaded the HTML, CSS and js files.
I added them to the project and referred to them in the bundleconfig.cs. But still no success.
Thank you very much

How can I add PHP to a Joomla menu item?

Here's what I'm trying to do:
In Joomla 3.1, I'm using the K2 component to build a full content-driven news website.
All is well, but I just don't like the K2 Login module, and therein lies the rub. That module automatically generates two key links:
• Add Item
• My Page
I want to unpublish the login module and add both of these links to a standard Joomla menu. It's easy to add the "add item" link because it's essentially static.
But the "My Page" link is dynamic. I've found the PHP code that generates it:
<?php echo JText::_('My Page'); ?>
But I don't know how to make a plain old Joomla menu item -- as in, one that I add through the menu manager -- to generate that code.
Note: It's important that I be able to use the Joomla menu structure because I'm also using Joomla's access control to hide or show these buttons. Meaning, I've added a "contributor" usergroup, and I only want them to see these links.
Any bright ideas would be much appreciated! Thank you!
You should go to the template you are currently using, in their you create a html folder.
In that folder you create a mod_menu folder.
Than you got your Joomla root > modules > mod_menu.
And copy files which are inside and drop them in the html > mod_menu folder.
Now you can edit the mod_menu to your favors with a rewrite.
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Hope this helps you.

how to add fishpig "blog" link to main navigation in magento

I'm using Magento WordPress Integration I'm wondering how to add fishpig "blog" link to main navigation in magento ? Currently it's only adding a link to my top header navigation.
Thanks
The above answer correctly shows how to add a link to your toplinks, however this is included in the extension by default. If you want to do this, you can enable/disable this from the extension's configuration area.
If you are referring to the Topmenu (the Category menu), it is now possible to create a custom Menu in the WordPress Admin and have this automatically added to your Magento Topmenu.
To do this, create a menu in WordPress. If you only want a single link to your blog, create a menu with this just this link in. Next, login to the Magento Admin and go to the configuration area for WordPress Integration. Under the fieldset labelled 'Menu', you can enable menu integration and select your newly created menu.
This will only work if your theme uses the Magento Topmenu block, which is the default menu block for Magento 1.7. Some custom themes use a custom menu extension for this menu and it is highly unlikely that this custom extension will call the necessary event.
As always, ensure you are using the latest version of WordPress Integration as this feature is quite new and has only recently been added.

Why does Joomla require a Component to be in the Administration Components Menu?

It seems like this shouldn't be an issue, but I created a generec Ajax component to use for custom Ajax calls. However, I discovered that Joomla requirees a component to be present on the Administrator Components Menu. You even have to specify this in the Component's xml file for this to work properly. Is there anyway to stop this?
thanks!
There is a good explanation in book "Mastering Joomla 1.5 - Extension and Framework Development" by Jams Kennard on how to create XML-RPC extensions like plugins.
Before you start have a look here:
http://docs.joomla.org/Generating_JSON_output
http://groups.google.com/group/joomla-dev-cms/msg/c513fe8ef8039083
and http://docs.joomla.org/Xml-rpc_changes_in_Joomla!_1.6
Also Joomla sources can give a lot of related information
EDIT:
ok, let say the only way I can imagine doing this is to remove the link directly from the DB just after your component has been installed (or later):
in your manifest file:
<administration>
<menu>Example Menu Item Text</menu>
<submenu>
<menu link="anoption=avalue">Example Submenu Item Text</menu>
</submenu>
</administration>
<install>
<sql>
<file driver="mysql" charset="utf8">example.install.sql</file>
</sql>
</install>
in example.install.sql:
DELETE FROM jos_menu WHERE (title = "COM_YOUR_COMPONENT" OR title = "com_your_component") AND client_id = 1
but to be onest, I've never used it and I don't known if joomla installer will run it in this order:
create manu item
delete manu item
There is a good way to manage the administration menu through advanced admin menu
http://www.theartofjoomla.com/extensions/advanced-administrator-menu.html
You can group your component in a special or existing tab to bring it out of attention
I know in Joomla 1.5 it does'nt require a component to be in that menu? Just don't tell it to put it in the menu! In your component's XML, just make sure the 'administration' block doesn't have a 'menu' entry, like so:
<administration>
<files>
<filename>blah... </filename>
</files>
</administration>
Adding the '<menu>' element to the XML is what adds it to the admin components menu. Creating a post-install SQL file to go back and remove the menu item you've explicitly added seems a bit crazy to me?

How to use Joomla left sidebar position for a custom component menu

A client web site uses a Joomla template with lots of modules in the left column, but for the custom component I'm designing, those modules must be replaced by a vertical menu. The hack solution I came up with is to hide those modules with CSS:
div#leftpad > div {
display:none;
}
and then insert a <div id='compmenu'> in <div id='leftpad'> with javascript and set display:block. With jQuery, I could do
jQuery('#compmenu').appendTo('#leftpad').show();
The component displays a google map, so javascript is required anyway. Any Joomla experts here know of a more elegant or straightforward method to achieve the same result?
Why don't you use the build in Menu-Bind for Modules to hide them when your Module or Component is displayed, this would be a clean way. I think your Module/Comp is bound to a Menu item.
Edit:
For sure your client have to implement your Module/Comp the right way. Is is very bad to do something like this with a hack.
Create Menu-Item for your component (programtic)
Create a hidden menu
Add your component to that menu
Do unbound all modules from this menue
The Joomla API hold a good series of Tutorials about building components. I gone through them in the past but as I see they have improved them. As I understand your component is relatively straight forward so the default menu should be what you want. It is described in the install XML
<administration>
<!-- Administration Menu Section -->
<menu>MyMenuLink</menu>
<!-- some other stuff -->
</administration>
And will be available at the Joomla! menumanager after your client has installed your component. So I think it will be not that hard for you.
In Joomla, menu types are determined by the various Views specified by the installed components. If your component is properly coded to Joomla MVC standards, you should have at least one View, which will give you at least one menu type to choose from. As sra mentioned, even if you do not need a menu link, you should create a hidden menu so you can create a link so you have an itemID to work with and assign modules to.
There are a few extensions and websites that can help create the necessary files for a component so all you have to do is add a little code. Once you understand the Joomla MVC it's really not too difficult.
http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
Doing it this way will save you a lot of headache later when the end user has to figure out how to use your component.

Resources