Page 1 of 1

[solved]content blocks and content alias (a bilingual cmsms site)

Posted: Tue Nov 06, 2007 4:34 pm
by Chris..S
I am setting up a small site using CMS MS for which most of the pages are available in two languages.  My idea was to set up a primary heirarchy of pages in the main language.  Have those pages use a template with some dummy code to trigger a second content block (e.g. {if (1==0)}{content block="minor langugae"}{/if} ), giving me pages with content areas for both languages next to each other.  Then to create a secondary heirarchy of pages in the minor language and use the content alias to reference the original page which will use a slightly different template to show the minor language content rather than the default content.

The only problem is that the content delivered by content alias doesn't seem to have the secondary content blocks.  Looking at the code in the module, it appears that content alias when asked for content, gets a content object from the original source and then replaces some of the fields (e.g. page id, page alias) and hands the object over to whatever asked for it.  There doesn't seem to be any place for the secondary content blocks to go missing.

Can any one provide any ideas/help as to what I need to do to get secondary content blocks into the content alias page?

Note, I don't want to have to swap the content around in the main pages so that the default content is the minor language and the secondary content block is used for the main language (content blocks work fine in those pages).


CMSMS1.2, ContentAliases 0.6.2

Re: content blocks and content alias (a bilingual cmsms site)

Posted: Tue Nov 06, 2007 4:48 pm
by alby
Chris..S wrote: Note, I don't want to have to swap the content around in the main pages so that the default content is the minor language and the secondary content block is used for the main language (content blocks work fine in those pages).
Have you look this

Alby

Re: content blocks and content alias (a bilingual cmsms site)

Posted: Tue Nov 06, 2007 7:00 pm
by Chris..S
Maybe I am missing something, but I don't see how that thread is relevant.

{content block="something"} works fine in the template of a normal page.  It isn't working for me when the page is a "contentalias" page.

Re: content blocks and content alias (a bilingual cmsms site)

Posted: Tue Nov 06, 2007 11:04 pm
by alby
Chris..S wrote: Maybe I am missing something, but I don't see how that thread is relevant.

{content block="something"} works fine in the template of a normal page.  It isn't working for me when the page is a "contentalias" page.
Yes, in content alias it can not working but in a normal page you can retrieve a content of "other" page (page in a secondary tree language?) if I read well that topic  :-\

Alby

Re: content blocks and content alias (a bilingual cmsms site)

Posted: Sun Nov 11, 2007 11:46 am
by Chris..S
That is correct ... see last para of my first post, I don't want to go that way as its not ideal for the content editors to see the secondary language listed first.

Re: content blocks and content alias (a bilingual cmsms site)

Posted: Tue Nov 13, 2007 2:48 am
by Chris..S
Solved.

In the contenttype.contentalias.php file, the method Show() needs to take a parameter and pass that parameter through to the content block Show() method.

e.g.

Code: Select all

@@ -147,13 +147,13 @@
                }
        }
 
-       function Show()
+       function Show($param='')
        {
                global $gCms;
 
                // Get the content that's being pointed at, and return it
                $contentobj = ContentManager::LoadContentFromId($this->GetPropertyValue('alias_target'), true);
-               return $contentobj->Show();
+               return $contentobj->Show($param);
        }