cotonti.com : Ajax pages, lists, etc https://www.cotonti.com Последние сообщения в теме Cotonti en Sat, 31 Jan 2026 18:14:31 -0000 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:

  • Request a page via XHR (AJAX).
  • Pass _ajax=1 in the URL.
  • Hack index.php and put $_GET['_ajax'] = 1 at the top of it.
]]>
пн, 10 дек 2012 14:29:05 -0000
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?

]]>
пн, 10 дек 2012 12:19:54 -0000
Trustmaster It is absolutely global.

]]>
пн, 10 дек 2012 12:13:14 -0000
tensh Thank you :)

Is it only for pages, or can this be set globally for any pages, plugins, modules??

]]>
пн, 10 дек 2012 11:47:08 -0000
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.

]]>
пн, 10 дек 2012 11:05:13 -0000
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.

]]>
пн, 10 дек 2012 10:03:34 -0000