Page 1 of 1

InitializeFrontend- get page id

Posted: Sun Aug 12, 2012 10:55 pm
by kuzmany
Hello folks,

is there way to find current page id in InitializeFrontend function?

I need for my MleCMS module and CmsNlsOperations::set_language_detector($obj) usage.

get_pageid_or_alias_from_url() is internal and private function, its use violates the rules, its use violates forge rules-

Thank you.

Re: InitializeFrontend- get page id

Posted: Sun Aug 12, 2012 10:59 pm
by calguy1000
cms_utils::get_current_pageid();
cms_utils::get_current_content();

Though I don't know if that will work... because modules (those that aren't lazy loaded) are loaded before the url is parsed and before the e content object is loaded.

Re: InitializeFrontend- get page id

Posted: Mon Aug 13, 2012 8:44 am
by kuzmany
Yeas, content object is loaded after this function and is unusable with/without lazyloading.

Thank you, I will try to find another way.

Re: InitializeFrontend- get page id

Posted: Mon Aug 13, 2012 8:49 am
by nockenfell
kuzmany wrote:Yeas, content object is loaded after this function and is unusable with/without lazyloading.

Thank you, I will try to find another way.
if you have a soluction, can you share it?

Re: InitializeFrontend- get page id

Posted: Mon Aug 13, 2012 11:07 am
by kuzmany
nockenfell wrote:
kuzmany wrote:Yeas, content object is loaded after this function and is unusable with/without lazyloading.

Thank you, I will try to find another way.
if you have a soluction, can you share it?
InitializeFrontend not used in my solution. I will try to use some event.

[Solved] Re: InitializeFrontend- get page id

Posted: Tue Aug 14, 2012 7:06 am
by kuzmany
My bad.

This works with disable LazyLoadFrontend in CMSMS 1.11.1