how to change content of template postion by a component in joomla - php

what i need is, when component run,component change content of position.
for example when url is: index.php?option=com_test , content of position 'left' = test and when url is: index.php?option=com_users, position show default data by modules.
i want tp change content of modules in this position too.
i have viewed https://joomla.stackexchange.com/questions/1054/displaying-a-joomla-module-using-php but this is for view module in component.

One way to achieve this is to install the free or paid version of Advanced Module Manager.
You can publish multiple versions of your modules in the required module positions and control when each one is displayed via the component.

Related

Joomla articles from category filled in module positions

I want to show all the articles from a certain category in different module positions. 
How I think it needs to work. I make a plugin that collects all the articles with their information in a central array. This array get emptied one by one in the module positions that I specify. I presume you'll also need a module that adds to the plugin so the plugin needs to know where the items need to go.
But is this the way to go or do you recommend something different? Maybe it already exist in a component or module?
Why are you making your own plugin to show Joomla article since Joomla already have it Just follow the following steps to create article category module in Joomla.
Create module under extension->module->new->choose-Article-categories
Now choose the article category and the position where you want to publish it. You can choose already available positions or you can create it on the fly.
If you want to publish module in custom position then check this link https://api.joomla.org/cms-3/classes/JModuleHelper.html

menu drupal in multilingual site

I can't see any menu in the EN version of my drupal site with the following settings in my menu :
When I select french all is ok but when I select english, nothing appears (I have content in both menu indeed)
In the blocks section, I see the two menus disabled.
Thanks to help me :-)
I would suggest using menu block contrib module.
This module will allow you to treat your menus as blocks.
Create 2 blocks (1 for each menu), and in block administration page you can specify the language for each block.
As there are usually several ways to reach a goal with drupal here is a proposal for a work around:
Create two menus with no language settings.
Try to put all menu items as neutral language so they show
up in both languages. (test that)
Assign the menus as blocks to the right region.
Then use the i18n module to control the language specific
display at the block level instead of the menu or menu item level. (Note you need the i18n_block module to do that which is part of the i18n module)
If you need aditional settings for the blocks see the allready mentioned menu block module.
Also make sure you check the internationalisation documentation.
I find that having two menus is always easier for multilingual websites.
I also prefer to use different views pages for different languages so I don't run into problems. That way I can add the path to the corresponding menu easily. Whenever I have tried to combine multilingual views and menus I have faced numerous problems.
In the screenshot you included I can see you have two menus.
First of all, I find it easier to name and title the menus according to their language because it's easy to get confused otherwise i.e. Main Menu English - main_menu_en.
Secondly, your french menu probably works because it's printed by your theme which is configured to render the main menu links in the specific region. To get your English menu to work you'll have to either:
a) add the required code in your theme, or
b) remove the code for the main menu in your theme and use 2 menu blocks placed in the desired region via the block admin page. In the block settings for each block you can select which language they'll be displayed for.
As the others said, you'll need: menu_block
If you need help with adding or removing the menu from your theme, please tell us which theme you are using.
There is a Seven Steps to achieve :
Step 1: Enable all modules
Content Translation (core module)
Locale (core module)
Internationalization
Variable
optional:
Language Icons
Translation Overview
Step 2: Add a language
Go to Configuration > Regional and Language > Languages
The default language is English, and you can use the “Add Language” link to add either Predefined or custom languages.
Step 3: Detection and Selection
For this tutorial I’ve chosen to use the “URL Prefix” setting. This tells Drupal to use domain.com/es for Spanish and domain.com/de for German.
Step 4: Enable Multilingual Support for content types
Either create or edit an existing Content Type and click “Publishing Options”. Here you will see the option for enabling multilingual support. Select “Enabled, with translation. This will allow you to translate a node into multiple languages.
Step 5: Create English Content
When you create your nodes, make sure you are using the correct language, not just “Language neutral”. This is important because when you create the URL alias and Menu link title it will know which menu to put the link in.
Once you’ve created your node you should see a “translate” tab. If you click this tab you’ll be able to add a translation to this node.
Note that if you have the “Translation Overview” module installed (I highly suggest it) you’ll get a nice little window that tells you which languages you’ve added, which require priority, etc.
Step 6: Created the translated content
When you create your translation give it a translated menu link title, but give it the same url alias as the original node. Because you have multilingual support installed, it won’t give you any errors for having the same URL alias (remember, it’s putting the Spanish nodes at domain.com/es and the German nodes at domain.com/de).
Step 7: Add support for multilingual menus
Go to Structure > Menus > Main Menu. Edit the menu and enable the “Translate and Localize” option. This will switch your menu items depending on what language the user has selected site-wide.
You’ll see you have both the English menu items and the Spanish items. You can order these like you wish, but know that only the Spanish links will show up when Spanish is selected as the main menu (you’ll know because the URL will say domain.com/es).
And your final product: In front end you can see it action .
Also you can use i18n_menu_navigation_links function.

How to display content at component position in joomla?

I have developed one search module which searches users in joomla. My problem is it displays content in same module, rather I want it to display at component position. I am not using any other component in that page. My Joomla version is 2.5
Any suggestions???
Under Joomla!'s MVC a module's output is rendered only into the module position, to have content rendered in the main component position you will have to create a matching component that responds to the modules search request.
Sounds like you need to develop it as a component instead of a module. It could probably easily be acheived using the Joomla Component Creator

Developing Component: Error With Menu Item

I'm trying to learn how to develop a Joomla component, according to this tutorial:
http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01
I'm on Part 4. My problem is that I build the component and zip it, then install. But Joomla adds -"component" word after my component's name, in folders and in menu item.
For example, let's say my component's name is "stack". So it's "com_stack". I build it that way, when I install it, folders in /components and /administrator/components are "com_stackcomponent". And the link under Components menu is "administrator/index.php?option=com_stackcomponent" So it doesn't open it.
I can manually change folders' names, but how to change the link under menu?
Or, how to solve it from the beginning?
Its doing that because you stopped at step 4 of 17 steps. A few steps later it explains how to properly name the component.
To fix the link in the menu, go to phpMyAdmin and search for "stackcomponent", then edit accordingly.
Unfortunately its not really a solution to your problem - I've not used Joomla 1.6 so don't know why it would be doing that.

how to display a component at a specific position in joomla template?

I have developed few custom components for joomla. Whenever I execute these components they appear at a specific position in template say the position name be 'showcase' what I wanna do now is
how to display the component at some other arbitrary position say 'showcase2'.
Help me out my project is stuck due to this???
Thanks in advance.
Create the code you want to display as a module rather than a component. Components are designed to appear in the "main" portion of your page. If you need to, you can reference some of your component code from the module. I wouldn't recommend running the component in a wrapper in the module.
Note that exactly one component is run in each request to Joomla.
To do this most people provide a companion module that can render the component in a module position. Essentially this could just be a wrapper around the component with some simple parameters that have some fine tune control over the layout (e.g. max width, alternate style)

Categories