| tensh |
|
|---|---|
|
Hello; I'm currently developing a mobile theme for Cotonti using jQuery mobile. For flawless functioning, it requires linking to pages without header and footer (content delivered by ajax). I remember there was once a view module, did it support displaying Cotonti content like this? Is there a ready-to-go solution or will I have to write some kind of plugin for this? When I'll be ready, I'll publish the theme with some plugins if there will be any needed. |
| Trustmaster |
|
|---|---|
|
View module can only display plain output of .txt and .html files. What you need is AJAX mode. When a page is requested via AJAX, the constant is defined:
define('COT_AJAX', true);
and header/footer are not printed. May the Source be with you!
|
| tensh |
|
|---|---|
|
Thank you :) Is it only for pages, or can this be set globally for any pages, plugins, modules?? |
| Trustmaster |
|
|---|---|
|
It is absolutely global. May the Source be with you!
|
| tensh |
|
|---|---|
|
Hmm, I made a test plugin like this:
<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=global
[END_COT_EXT]
==================== */
defined('COT_CODE') or die('Wrong URL');
define('COT_AJAX', true);
?>
... yet it still displays the header and footer everywhere. I purged the cache. What am I doing wrong? How to tell Cotonti that something is requested via ajax? |
| Trustmaster |
|
|---|---|
|
Oh, sorry, COT_AJAX is a constant and it is always predefined in common.php line 190:
define('COT_AJAX', !empty($_SERVER['HTTP_X_REQUESTED_WITH']) || !empty($_SERVER['X-Requested-With']) || $_GET['_ajax'] == 1);
So changing it doesn't really work. Instead, you have a few options:
May the Source be with you!
|