Access to page properties

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
chandra

Access to page properties

Post 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?
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: Access to page properties

Post by staartmees »

chandra

Re: Access to page properties

Post 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.
chandra

Re: Access to page properties

Post by chandra »

And please move my topic back to developer section - thx.
faglork

Re: Access to page properties

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Access to page properties

Post 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.
chandra

Re: Access to page properties

Post 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.
chandra

Re: Access to page properties

Post 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.
Post Reply

Return to “The Lounge”