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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Chris..S
Forum Members
Forum Members
Posts: 23
Joined: Thu Apr 20, 2006 5:23 pm

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

Post 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
Last edited by Chris..S on Tue Nov 13, 2007 2:48 am, edited 1 time in total.
alby

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

Post 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
Chris..S
Forum Members
Forum Members
Posts: 23
Joined: Thu Apr 20, 2006 5:23 pm

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

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

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

Post 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
Last edited by alby on Wed Nov 07, 2007 3:01 pm, edited 1 time in total.
Chris..S
Forum Members
Forum Members
Posts: 23
Joined: Thu Apr 20, 2006 5:23 pm

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

Post 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.
Chris..S
Forum Members
Forum Members
Posts: 23
Joined: Thu Apr 20, 2006 5:23 pm

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

Post 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);
        }
Last edited by Chris..S on Tue Nov 13, 2007 2:55 am, edited 1 time in total.
Post Reply

Return to “CMSMS Core”