joomla2.5

creat new options to joomla component when creating new menu item

折月煮酒 提交于 2019-12-11 06:46:07
问题 I searched internet for good explanation how to create additional options when creating new menu item. For example: i created component to sell chips of different companiens when creating menu option it to show only chips of company xyz and not from all companies. Similar work-flow is when we want to add article as new menu item. Field where 'Required Settings' is. Please show me code responsible for it or good tutorial . 回答1: If you are looking for menu options for your custom component, you

Whats is assignRef() function in joomla 2.5

若如初见. 提交于 2019-12-11 06:33:08
问题 i am trying to understand about how to develop custom components in joomla 2.5 and on the very first step i get stuck and i want to know what is the use assignRef() function and for more info click here <?php /** * @package Joomla.Tutorials * @subpackage Components * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1 * @license GNU/GPL */ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); /** *

Joomla 2.5 Load custom field in components layout fatal error

孤街醉人 提交于 2019-12-11 05:09:10
问题 Im trying to load custom field in my backend component default view (default.php): JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); $productType = JFormHelper::loadFieldType('ProductType',false); $productTypeOptions = $productType->getOptions(); But I get a fatal error: Fatal error: Call to a member function children() on a non-object in xxx\libraries\joomla\form\fields\list.php on line 89 When I load this custom field into the form, everything works perfectly. Any ideas? 回答1:

Joomla 2.5 render com_content component output

你说的曾经没有我的故事 提交于 2019-12-11 04:08:19
问题 is it possible to render Joomla content from external script? For example I have some html string, which I want to pass to com_content component, to make all content plugin and module features available. I think I should use JDocumentRendererComponent class. Code in my external file: <?php require_once ('framework.php'); //loading joomla framework jimport('joomla.document.html.renderer.component'); $contentHtml = '<p>Some content html</p>'; echo JDocumentRendererComponent::render('com_content

Joomla: Write and call a helper function in a component

*爱你&永不变心* 提交于 2019-12-11 03:12:45
问题 Fledgling Joomla / PHP developer, hitting a wall understanding how to do this. Everything I found searching has been for older versions of Joomla or other frameworks and so it's all confusing the first time around. I want to have a helper function that I can call from anywhere in my component. Basically it takes a userID input and returns their full name, let's say hair color and height. Here's the function: function get_profile_info($userID) { $db =& JFactory::getDBO(); $query = $db-

How to get Joomla K2 item as object on category page?

爱⌒轻易说出口 提交于 2019-12-11 02:57:26
问题 I need to get all the items of specific K2 category as object in templates/mytemplate/html/com_k2/default/category.php. Something like: foreach($this->category->items as $item) { echo $item->image; } but I dont' know API of K2 component. To get not only $this->leading or $this->primary or $this->secondary with their limits but ALL the items of the current category 回答1: You may get it with direct query to MySQL: $catid = $this->category->id; $db = &JFactory::getDBO(); $query = $db->getQuery

Joomla 2.5 JFactory::getSession(); seems to be caching in firefox

半城伤御伤魂 提交于 2019-12-10 23:05:15
问题 I have a php file in includes directory. It's usability is to display a captcha Image. In that file I set a session variable like this: $code = codegenerator(); $session =& JFactory::getSession(); $session->set('security_code', $code); This Session variable is set from an image src that calls that method from a controller. Then I call a controller to check that session that was set (this method is trigerd with ajax from an iframe) and in that method I do this $session = JFactory::getSession()

Menu item title overriding setTitle in module

时光怂恿深爱的人放手 提交于 2019-12-10 21:15:38
问题 I've encountered a scenario where the menu item Title specified on the Joomla back-end in Menu Manager overrides the following call: JFactory::getDocument()->setTitle('Custom title') The document's title becomes 'Custom title' up until the following lines in components/com_content/views/article/view.html.php : if (empty($title)) { $title = $this->item->title; } $this->document->setTitle($title); I assign a new title to the document in my module: JFactory::getDocument()->setTitle('New title');

How can I change the Joomla administrator URL By PHP - No plugins

▼魔方 西西 提交于 2019-12-10 18:44:35
问题 Since I'm new to Joomla I would like to know whether there is a way to change the administrator URL by using PHP rather than using a plugin or extensions. As far as I see using a 3rd party component is risky. I really don't want to use 3rd party extensions at all in mysite. How can I get it done? By default Joomla administrator URL is yoursitename/administrator. changing constants in /includes/defines.php and /administrator/includes/defines.php does not work . Thanks 回答1: referring this post

Joomla 2.5 creating component and saving data

匆匆过客 提交于 2019-12-10 17:49:54
问题 I have been using this documentation (the only one I can find on the web) to build a component: http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2.5/Introduction I can understand it to a certain extent, however it does really lack any definition. The component I have created works to a degree, though I am having some wier problems. Basically all I need the component to do is simply load a settings area to set a few values, and through it be able to change those values. Here