Load page title in joomla 2.5 content - joomla

I am looking for a way to load a page title in the Joomla 2.5 content for SEO purposes. I know in joomla you can use a function to load a module such as {loadposition box1}.
Is there a way to have a feature or does anyone know an extension so you can do something similar to this {loadpagetitle}.
This will save me hours of work.
Thanks.

Firstly, install the Direct PHP plugin and enable it.
Then copy and paste the following code into your article:
<?php
$mydoc = JFactory::getDocument();
$mytitle = $mydoc->getTitle();
echo $mytitle;
?>
Make sure you use the php tags though.
Hope this helps. Regards.

Related

how to give the url in joomla supporting form

I’m new to joomla and I’m using joomla 2.5. I need to redirect the page in joomla to another page. I saw that JROUTE is used for giving urls in joomla. but it start only from joomla folder. I need to get a file in the path
http://localhost/joomla/images/uploads/file.pdf
how can I write the above URL in joomla standard format?? can I use JURI base with jroute ??
Try this,
echo JURI::root().'images/uploads/file.pdf'
JURI::root() will return the site url.
If you required physical path try JPATH_SITE
Hope it helps..

how to call a joomla! module in a php page OUTSIDE joomla! directory?

i searched on the net for my answer,but the more i search,the less i find.here is the problem:
i have a joomla! website,located in localhost/joomla.
i have a php page, located in localhost/sample.php
now, how can i include some of joomla's modules,in this single "sample.php" page??
for example, how can i use "latest news" or "latest users" in my "sample.php" page?
one of mye friend did this, but i no longer can contact him. any help would be appreciated. if the question is not clear enough,plz let me know.
tnx
load the Joomla framework inside the external php file
like it says here http://www.irfanview.0fees.net/how-to-load-the-parameters-of-a-joomla-module-inside-an-external-php-file/
I've never had to do this, but first I think you would have to load the Joomla framework (see the installations root index.php) then you would have create a session using Jsession. This is just a guess so take it for what its worth.

Codeigniter redirection

Hi I created a codeigniter project but when I click on a link to one of my functions, example add user, I get redirected to the main page of my local host XAMPP installation instead of being taken to the correct application url. What can be the problem? Thanks
Have you set the base URL in the CI configuration? file projectname/application/config/config.php? This might be the problem... I guess your project isn't on the webroot, but your base URL is missing the /projectname/ part.
$config['base_url'] = 'http://example.com/projectname/';
How do you create the link (can you show us the code)? If you are not using the URLHelper take a look at urlHelper.
I am just guessing, but maybe you are missing the Controller name (you have to load the UrlHelper), e.g.:
Link to the controllers method
or (see Jordan Arsenault's comment below on the usage of the site_url call for better performance):
<?= anchor('/name_of_the_controller/method_to_invoke', 'Link to the controllers method'); ?>
I hope this helps.

How to include javascript in Joomla virtuemart product details

I am actually customizing product details page with the help of http://virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html this page. I need to include some external and internal JavaScript.But don't know were to add script.Please some one help me to do this.
To modify product details page . i just worked in following file components/com_virtuemart/themes/default/templates/product_details/flypage.tbl.php.
Virtuemart version is VirtueMart 1.1.9 stable
Joomla Version is Joomla! 1.5.15 Stable
Thanks In advance.
Based on your responses in the comments here is the answer:
//This line defines what JavaScript file you wish to add, change it as needed.
$myJsFile = JURI::Base() . 'templates/my_template_name/js/myJsFile.js';
//this line fetchs the jdocument object which is needed to add items to the head (amongst other things)
$document =& JFactory::getDocument(); //Drop the & if PHP5
//This line adds the previously setup JS url
$document->addScript($myJsFile);
If you want to add or something custom like IE conditional tags then see here for more info: http://docs.joomla.org/Adding_JavaScript_and_CSS_to_the_page on how to use this object.

Disable MooTools in VirtueMart

I'm creating a custom module for displaying VirtueMart categories, but need to disable VirtueMart from loading MooTools because it uses an older version of MooTools than what I need. I've searched everywhere, but I can't seem to find the file or function that will allow me to disable it. Any help would be greatly appreciated.
At least in virtuemart 1.5 go to
components/com_virtuemart/themes/YOURTHEME/theme.php
find line about 37, there is a function:
function vmTheme() {
parent::vmTemplate();
vmCommonHTML::loadMooTools();
}
Just comment
vmCommonHTML::loadMooTools();
The only reference to it in the entire project is in mod_virtuemart_currencies.xml. I'm not 100% familiar with Joomla, but this looks like an installer file for a particular currency module.
I'd suggest removing that module, or updating the reference to the MooTools library it's using inside that XML file (line 30 in the currently available version, inside modules/mod_virtuemart_currencies_1.14.j15/mod_virtuemart_currencies.xml).
I was able to resolve my issue. My custom module was using JHTML::script() to load my JavaScript files. That particular function has a third parameter that defaults to true that will automatically load MooTools. You can see the documentation here: http://docs.joomla.org/Adding_JavaScript
If that doesn't do it, put this in your template and it will remove any of the default scripts that Joomla tries to use. Obviously this might remove things necessary for Virtuemart to work right, but it might solve your problem too.
<?php
$user =& JFactory::getUser();
if ($user->get('guest') == 1) {
$headers = $this->getHeadData();
$headers['scripts'] = array();
$this->setHeadData($headers);
}
?>
I created a custom component for front and back ends, and I couldn't (for the life of me) disable mootools. I tried unsetting headers array and all that, and it didn't work!
It worked fine for regular pages where the component was a regular article, but not when it's my custom component.
I was using the JHTML::script() function in my template, and after reading one of the comments here, I tried adding a second parameter (FALSE) to the function and it worked!
Thank you!!!
Any ideas why unsetting mootools from the $document variable's _scripts array doesn't work with custom components?

Resources