Recent Topics

Get current page title with API

Started by on May 28, 2008 – Contents updated: May 28, 2008

May 28, 2008 12:15    

Hi,

I'm a developper of an open source web analytics software (spongestats.org).

I have developped a new feature for version 3.1 to get the page title from the current page based on an API.
Actually, only Wordpress is integrated but I would like to integrate some other CMS/Blog platforms, so I would like to know if there is an API feature included in MODX that I can use to get the current page title.

For example, in Wordpress, I use the API feature wp_title('',false);

Do you know if something similar is available in the B2Evolution API and if I can use it in an external marker ?

Regards,
Bastien.

May 29, 2008 16:27

No one can help me about this issue ?

Thank you.
Bastien.

May 29, 2008 19:30

Hi there,
The title in the skin is created by this section of code :

	<title><?php
		// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
		request_title( array(
			'auto_pilot'      => 'seo_title',
		) );
		// ------------------------------ END OF REQUEST TITLE -----------------------------
	?></title>

AFAIK there is no easy way to "grab" the value without resorting to ob_start();

<?php
ob_start();
request_title( array(
	'auto_pilot'      => 'seo_title',
) );
$the_title = ob_get_clean(); // don't use $title or you'll cause errors with links on the page ;)
?>

¥

May 29, 2008 20:35

Great, I think I will use the second one.

I'm doing almost the same thing for Dotclear 1.

Thank you.
Bastien.

May 29, 2008 20:44

No problem, feel free to post back if you need any more help .... and don't forget to let us know when your plugin is ready ;)

I for one have always wanted to see my stats in french ..... probably make about as much sense as when they're in english :-S

¥

May 29, 2008 20:56

I think I will post a link to download the BETA tomorrow or next week :)

The web site is in french but the software is localised in FR, EN, IT and DE, it could be better for you :)

Jun 03, 2008 20:23

Hi,

You can tnow download the BETA version and set the type of CMS as B2Evolution in the administration panel.

I hope everything works fine in the english version, if not, see the tab "administration" or send us an email via the support page : http://www.spongestats.org/support/

Download BETA version : http://downloads.sourceforge.net/spongestats/SpongeStats-3.1-BETA1.zip
More infos in french : http://www.spongestats.org/?2008/06/04/38-spongestats-31-beta-1-est-disponible&cos=1


Form is loading...

Advanced CMS – This forum is powered by b2evolution CMS, a complete engine for your website.