Page 1 of 1

UDT stopped working after upgrade to CMSMS Version: 2.1.1

Posted: Wed Jan 13, 2016 5:44 pm
by naturelab
I use this UDT to pull content from other pages. It has stopped working completely in 2.x.x. Any pointers ?

Code: Select all

$alias = isset($params['alias']) ? $params['alias'] : '';
$box = isset($params['box']) ? $params['box'] : '';
global $gCms;
$cgsimple = $smarty->get_template_vars('cgsimple');


$page_content = $cgsimple->get_page_content( $alias , $box);
echo $page_content;
I use it like this :-

Code: Select all

{Gallery dir={pull_content alias=$child.alias box='Gallery'}
or this:-

Code: Select all

{{pull_content alias=$child.alias}|cms_html_entity_decode|trim|strip_tags|summarize:10}
*********************

Code: Select all

Cms Version: 2.1.1

Installed Modules:

    AdminSearch: 1.0
    CMSContentManager: 1.1
    DesignManager: 1.1.1
    FileManager: 1.5.2
    MenuManager: 1.50.2
    MicroTiny: 2.0.2
    ModuleManager: 2.0.1
    Navigator: 1.0.2
    News: 2.50.3
    Search: 1.50.2
    Gallery: 2.0.3
    CGExtensions: 1.51
    CGSimpleSmarty: 2.0.2
    CGContentUtils: 2.1
    JQueryTools: 1.3.8
    CGBlog: 1.13.3
    CGSnapshot: 1.0

Re: UDT stoped working after upgrade to Cms Version: 2.1.1

Posted: Wed Jan 13, 2016 5:54 pm
by calguy1000
The CGSimpleSmarty library changed for 2.x thus breaking it. That change is well documented.

But there is no need for that UDT any more.

see the 'page_attr' plugin distributed with 2.x
you can retrieve all of that information without using CGSimple.

Re: UDT stopped working after upgrade to CMSMS Version: 2.1.

Posted: Wed Jan 13, 2016 5:56 pm
by naturelab
Thankyou for the quick reply. I will look into it now. Appreciate your time

Re: UDT stopped working after upgrade to CMSMS Version: 2.1.

Posted: Wed Jan 13, 2016 6:58 pm
by naturelab
Ah, but I need to use it in this contex:-

Code: Select all

{cgsimple::get_children('',0,'children')}
{if count($children)}
   {foreach from=$children item='child'}
      {if $child.show_in_menu}
      {Gallery dir={pull_content alias=$child.alias box='Gallery'}
      {/if}
   {/foreach}
{/if}
The page_attr tag has a key that can be used for the block name
key [required] The key to return the attribute of.
The key can either be a block name, or from a set of standard properties associated with a content page.
But I don't understand how to access content from another page, other than the current one ?

Code: Select all

 {Gallery dir={page_attr key='Gallery' }
Where would the

Code: Select all

alias=$child.alias
bit go ?

Re: UDT stopped working after upgrade to CMSMS Version: 2.1.

Posted: Wed Jan 13, 2016 7:36 pm
by velden
Looks like something you can do from within a Menu template (Navigator)

Re: UDT stopped working after upgrade to CMSMS Version: 2.1.

Posted: Wed Jan 13, 2016 7:40 pm
by calguy1000
But I don't understand how to access content from another page, other than the current one ?
From the help:
- (optional) page (int|string) - An optional page id or alias to fetch the content from. If not specified, the current page is assumed.
- key [required] The key to return the attribute of.

Re: UDT stopped working after upgrade to CMSMS Version: 2.1.

Posted: Wed Jan 13, 2016 7:41 pm
by calguy1000

Code: Select all

{$children=cgsimple::get_children()}

Re: UDT stopped working after upgrade to CMSMS Version: 2.1.

Posted: Wed Jan 13, 2016 7:55 pm
by naturelab
Gamechanger ! :) cheers