Page 1 of 1

Access to page properties

Posted: Thu Apr 24, 2014 11:21 pm
by chandra
Hi guys,

I'm trying to realize a multilanguage page. For the links to switch I'm using CGSimpleSmartys function get_parallel_page().

But currently only the content for one language is completed. For the second language there are only empty pages. These pages are not shown in menu.

So the idea is to show a link only than if the checkbox "Show in menu" is activated.

So I need access to page properties of the parallel page. How can I do that conform to the system?

Re: Access to page properties

Posted: Fri Apr 25, 2014 3:05 am
by staartmees

Re: Access to page properties

Posted: Fri Apr 25, 2014 5:03 am
by chandra
Many thanks for your fast answer - I really appreciate that.

But it doesn't answer my question - how to access the page properties. I'm knowing only the old access via $contentobj.

And - by the way - your linked solution has only a link to the lang root pages. My setting links all pages to his similar / parallel page.

Re: Access to page properties

Posted: Fri Apr 25, 2014 5:33 am
by chandra
And please move my topic back to developer section - thx.

Re: Access to page properties

Posted: Fri Apr 25, 2014 6:57 am
by faglork
chandra wrote:Hi guys,

I'm trying to realize a multilanguage page. For the links to switch I'm using CGSimpleSmartys function get_parallel_page().

But currently only the content for one language is completed. For the second language there are only empty pages. These pages are not shown in menu.

So the idea is to show a link only than if the checkbox "Show in menu" is activated.

So I need access to page properties of the parallel page. How can I do that conform to the system?
Well, I also do no have the answer for your question, but I just want to remark that the MLEcms module does that out of the box ... you set up parallel content trees, and only active pages get parallel linking.

I would seriously consider using this module, as it has a bunch of other functions for setting up a multilingual site. Not an easy module, though ...

hth,
Alex

Re: Access to page properties

Posted: Fri Apr 25, 2014 12:14 pm
by velden
Basic example without error checking etc:

UDT 'ShowInMenu'

Code: Select all

$gCms = cmsms();
$contentops = $gCms->GetContentOperations();
$content = $contentops->LoadContentFromAlias($params['pagealias']);
return $content->ShowInMenu();
Example use:

Code: Select all

{if {ShowInMenu pagealias=$page_alias}}yes{else}no{/if}
In your case I would consider to create one UDT to do all the work; find parallel page and determine if it should be displayed.

Re: Access to page properties

Posted: Tue Apr 29, 2014 8:08 am
by chandra
faglork wrote: just want to remark that the MLEcms module does that out of the box ... you set up parallel content trees, and only active pages get parallel linking.
Thx Alex - find this information nowhere.

But module powered linking does not work for me. In cause of the dead line I've used CGSimpleSmarty for that.

Re: Access to page properties

Posted: Tue Apr 29, 2014 8:13 am
by chandra
velden wrote: In your case I would consider to create one UDT to do all the work; find parallel page and determine if it should be displayed.
Works like a charm - thank you too.

With some modifications I can use it now for every key.