Elxis CMS Forum

Support => Technical support => Topic started by: timalsina on August 08, 2009, 13:37:29

Title: Template output override
Post by: timalsina on August 08, 2009, 13:37:29
Is there any way I could modify/override the output of mosMainBody(); on template level. The hardcoded output format in content.html.php under components/com_content/ directory is where I would make modifications to achieve desired output but I will have to patch the modification on each new Elxis releases.
Title: Re: Template output override
Post by: datahell on August 09, 2009, 08:58:39
CSS is not enough? What kind of changes you need?
Title: Re: Template output override
Post by: CREATIVE Options on September 23, 2009, 12:20:09
Yes, you can do it with 2 ways.

Simple: Assign template for specific page / pages.

Expert: With php inside the template "if com_xxxx" (sorry but I can't provide php code, because I don't know php), for that many other user can provide you with the right php code.
Title: Re: Template output override
Post by: datahell on September 23, 2009, 14:50:14
The needed php code is as simple as the following (use it in template's index.php file):

<?php
if ($option = 'com_xxxxxxx') {
    //load here the special template
}
?>
Title: Re: Template output override
Post by: timalsina on October 02, 2009, 12:56:40
The needed php code is as simple as the following (use it in template's index.php file):

<?php
if ($opiion = 'com_xxxxxxx') {
    //load here the special template
}
?>

Datahell, under //load here the special template area, can I make a call to database via query. I want to bypass mosMainBody() altogether in some cases.
Title: Re: Template output override
Post by: datahell on October 02, 2009, 13:29:35
You can query the database:
$database->setQuery("......");

"bypass mosMainBody"? what the f.... you want to do?  :o
Title: Re: Template output override
Post by: timalsina on October 02, 2009, 13:35:24
"bypass mosMainBody"? what the f.... you want to do?  :o

In some cases I need to hardcode the content so mosMainBody is not required.
Title: Re: Template output override
Post by: CREATIVE Options on October 02, 2009, 14:42:15
aha !!!

Thank you timalsina, for your choice using Elxis for your project.

Code: [Select]
http://www.timalsina.com/
Title: Re: Template output override
Post by: timalsina on October 02, 2009, 19:59:14
aha !!!

Thank you timalsina, for your choice using Elxis for your project.

Code: [Select]
http://www.timalsina.com/

You're welcome!
Glad to be part of the Elxis community. I am working on a travel guide portal where Elxis is being used extensively. I will utilize IOSReservations V3 as well. The content for the site will be forged from three channels: Site admins, editors and community members. Before picking Elxis, I did several benchmark tests and finally decided to go with Elxis as it passed most of the panic tests. I already tested Elxis running in a cloud hosting environment as well and Elxis runs flawlessly. I will actively seek community help and in the meantime contribute back what I think valuable to the community. I have allocated 10hrs./week hoping to finish this project within the next two and half months.  I am using one of the clean templates that I've developed in my personal site you've mentioned above.