joomla2.5

Programmatically Create Menu Item in Joomla

此生再无相见时 提交于 2019-12-01 06:37:53
I have created a component in joomla 2.5 that creates a new article and adds that article to a menu item. Creating the article is working fine, but I am having some trouble with creating the menu item. I have the following code: //add the article to a menu item $menuTable = JTable::getInstance('Menu', 'JTable', array()); $menuData = array( 'menutype' => 'client-pages', 'title' => $data[name], 'type' => 'component', 'component_id' => 22, 'link' => 'index.php?option=com_content&view=article&id='.$resultID, 'language' => '*', 'published' => 1, 'parent_id' => '1', 'level' => 1, ); // Bind data if

Programmatically Create Menu Item in Joomla

无人久伴 提交于 2019-12-01 05:04:15
问题 I have created a component in joomla 2.5 that creates a new article and adds that article to a menu item. Creating the article is working fine, but I am having some trouble with creating the menu item. I have the following code: //add the article to a menu item $menuTable = JTable::getInstance('Menu', 'JTable', array()); $menuData = array( 'menutype' => 'client-pages', 'title' => $data[name], 'type' => 'component', 'component_id' => 22, 'link' => 'index.php?option=com_content&view=article&id=

joomla spambots error

前提是你 提交于 2019-12-01 01:14:13
Using widgetkit map (external component by yootheme) in joomla 2.5, joomla detect when I insert an email address and give me this error This email address is being protected from spambots. You need JavaScript enabled to view it. Javascript obviously is enabled. do you have the plugin Content - Email Cloaking active ? Disable it and everything should be fine. If you're a programmer or webdesigner, you should look for any JavaScript error messages with a tool of your choice, which will help you to identify the problem. There are several possible causes. Here are two of them: Sometimes, a content

Joomla - Overriding getItem method

有些话、适合烂在心里 提交于 2019-12-01 00:03:15
I want to override the method getItem() found in file \administrator\components\com_content\models\article.php line 257 public function getItem($pk = null) I need to modify the return value based on the value of variable $pk. How do I do this? I am hoping to find a way to not to modify the core. Also, if override is possible, can I make a plugin out of it? Am using Joomla 2.5.9 With some more searching, came across a beautiful solution. All I needed was to override the model (article.php) under com_content. This got it done. Using the Plugin Override plugin the Joomla core can be overridden.

show only the content of article

风流意气都作罢 提交于 2019-11-30 23:09:05
how do I only show content in a single article? I am using Joomla 2.5 and Ajax to call a single article, but when I render the article in a <div> tag, I render again the header, the footer and all the page , but I only want the content. How do I configure the page or the article to show only the content? If you only want to get component you can append tmpl=component parameter with the url. Your article url will be like this- index.php?option=com_content&view=article&id=1&tmpl=component Or you can try like this- $('#result').load('index.php?option=com_content&view=article&id=1&tmpl=component

How to add a new view (and also a new Menu Item Type) to existing joomla 2.5 components?

大兔子大兔子 提交于 2019-11-30 21:54:04
Maybe I want to add a new view , and also a new Menu Item Type to content component. What are the steps please? UPDATE Question (by @ValentinDespa ) : You want to extend com_content functionality or you want to override a view or to build a new component that does something? As I said, I want to extend com_content and add a new view to it. There are some views like Single Article , Category Blog , and Category List right now. I want to add another menu items called Article Titles , so titles only will be displayed but with some parameters (like columns count). It is a need that is not supplied

How to add a new view (and also a new Menu Item Type) to existing joomla 2.5 components?

孤人 提交于 2019-11-30 17:56:25
问题 Maybe I want to add a new view , and also a new Menu Item Type to content component. What are the steps please? UPDATE Question (by @ValentinDespa ) : You want to extend com_content functionality or you want to override a view or to build a new component that does something? As I said, I want to extend com_content and add a new view to it. There are some views like Single Article , Category Blog , and Category List right now. I want to add another menu items called Article Titles , so titles

Joomla 2.5 displays wrong datetime

佐手、 提交于 2019-11-30 16:04:40
I have Created this code in a custom component that I made: $date = date('m/d/Y h:i:s a', time())."<br>"; echo 'Current date and time is: ' . $date; $date = JFactory::getDate(); echo 'Current date and time is: ' . $date->toFormat() ."<br>"; The first code displays the datetime correctly, but the second one displays the time +3 hours I have checked the configuration.php file and the public $offset = 'Europe/Athens'; and is correct. I am also changing the settings from the system configuration menu but nothing seems to be fixing the JFactory::getDate() to display the correct time. What am I

Write to multiple tables in joomla component?

▼魔方 西西 提交于 2019-11-30 05:09:20
I'm trying to create a component (front end) that uses multiple tables. I found 1 or 2 post that partially answer to the question but none really does. The point seems always simple and evident for the one who knows how to do it but it is never really explained (or I missed the right post). In my component, the user enters data in one view that need to be stored in two tables: the standard Joomla User table i.e. # __users an additional table to store data that are not included in Joomla i.e. # __users_complements I'm a beginner, so maybe I'm wrong, but I understood that the standard functions

How to get component parameters?

风流意气都作罢 提交于 2019-11-29 23:51:20
I have a problem here and just cant solve it :-/ I am developing an Joomla component with backend. In the backend I set a parameter, the dashboardId , but I can't access them in the view. I always get data:protected (when I dump params ). It seems like I'm not allowed to access the object. Here is the default.xml : <?xml version="1.0" encoding="utf-8"?> <metadata> <layout title="Dashboard"> <message> <![CDATA[dashboard LAYOUT DESCRIPTION]]> </message> </layout> <fields name="params"> <fieldset name="params"> <field name="dashboardId" type="text" label="Dashboard ID" description="com_dashboard