I am building a component using JSON in Joomla. That is very hard to do that. So far, I built in a view.json.php in views folder. But I could not call it. Well, that is easy! You just need to add a parameter ,format=json, in the url.
Archives for: September 2011
The traditional form drop down list is not very good for JSON and that is very hard to create some advanced css layout for it. So, I choose to use jQuery dropdown list. Finally, I shortlisted jALDropdown to be my choice. It supports JSON and CSS layout too! The documentation is comprehensive too!
I used "Contains" method in C# whether the strings contains a keyword.
For example:
Code:
string str = "string"; | |
if(str.Contains("str")) | |
{ | |
Console.Write("OK"); | |
} |
There is no such method, but you can "indexOf".
Code:
var str = "string"; | |
if(str.indexOf("str")!= -1) | |
{ | |
alert("OK"); | |
} |
I am writing two Joomla components during these few days. I got a problem, how to reference a javascript file in a Joomla Component. I used to do it in a cowboy way. I hard coded the path in the template! I should keep it inside the component!
I found the documentation, in the framework, that is a method calls AddScript. It will add a script in the header section. That is nice!
Code:
<?php | |
$document = &JFactory::getDocument(); | |
$document->addScript( 'components/com_<component name>/script/jquery.js' ); | |
?> |
But please adding this in the component xml file:
Code:
<files folder="site"> | |
........ | |
<folder>scripts</folder> | |
</files> |
It makes sure the script folder will be deployed.
Reference:
Joomla Documentation
I started to use Joomla 1.7. I found there is a lot of different aspects from Joomla 1.6. Some components are not working. All of templates I tried are not working in my Joomla 1.7 websites. Those templates are working fine in Joomla 1.5. I think Joomla group to consider deep on the backward compatibility. Thus, if you find a template, please make sure that is for Joomla 1.6+.
Recent comments