CMS Made Simple Forums
https://forum.cmsmadesimple.org/

[SOLVED] After CMSMS 1.10 upgrade pages are broken
https://forum.cmsmadesimple.org/viewtopic.php?f=3&t=57503
Page 1 of 1

Author:  ofrost [ Thu Oct 27, 2011 7:57 am ]
Post subject:  [SOLVED] After CMSMS 1.10 upgrade pages are broken

I used this construction in my template to access extra options of my pages: $content_obj->mProperties->mPropertyValues.extra1.

It looks like its not supported in cmsms 1.10. I get this error: Fatal error: Cannot access protected property Content::$mProperties in ....
As the result pages are not displaying correctly.

What do I use instead?

Author:  fredp [ Thu Oct 27, 2011 8:37 am ]
Post subject:  Re: After CMSMS 1.10 upgrade pages are not displaying correc

Hi,

I suggest you read through the CMSMS 1.10 API docs.

I think this might be what you're looking for:
\$1:
$xtra1 = $content->GetPropertyValue('extra1');
Hope this helps,
fredp

EDIT:
Also try searching the forum for related postings. E.g:
http://forum.cmsmadesimple.org/viewtopic.php?f=2&t=49083

Author:  ofrost [ Thu Oct 27, 2011 1:02 pm ]
Post subject:  Re: After CMSMS 1.10 upgrade pages are not displaying correc

Thank you Fred.
This string moves me further
\$1:
{if FALSE!==$content_obj->GetPropertyValue('extra1')|strpos:´slider´}

but now I get this error

\$1:
Notice: Undefined index: content in /var/www/virtual/mysite/new/htdocs/tmp/templates_c/%%07^075^0753AFA5%%template%3A29.php on line 150

Fatal error: Call to a member function GetPropertyValue() on a non-object in /var/www/virtual/mysite/new/htdocs/tmp/templates_c/%%07^075^0753AFA5%%template%3A29.php on line 150


Any ideas what they mean?

Author:  calguy1000 [ Thu Oct 27, 2011 2:17 pm ]
Post subject:  Re: After CMSMS 1.10 upgrade pages are not displaying correc

it's amazing the steps people will go to to NOT read the help, documentation, and list of available tags from within their own install.

Author:  ofrost [ Thu Oct 27, 2011 2:55 pm ]
Post subject:  Re: After CMSMS 1.10 upgrade pages are not displaying correc

First of all thank you for your work and things you do of cmsms.

It might sound funny for you calguy, but even list of "thing we have broken" in release notes doesn't make much sense for me. I'm not programmer and its a bit hard for me to get things working now.

This construction used to work fine in 1.9.4.3 and I was advised with this solution on IRC channel. So I'm not very competent in this things.

My goal is to use only one template for three different page layouts and get my site working with 1.10.

Author:  fredp [ Thu Oct 27, 2011 8:36 pm ]
Post subject:  Re: After CMSMS 1.10 upgrade pages are not displaying correc

@ofrost
Oops, sorry, I misread your OP last night. If you want this in a template, Calguy1000 is right, just use the {page_attr} tag that comes with the installation. See help on the Extensions » Tags Admin page.

Author:  ofrost [ Fri Oct 28, 2011 5:32 pm ]
Post subject:  Re: After CMSMS 1.10 upgrade pages are not displaying correc

So here is solutions in my case.

I have used extra1 parameter in page's options to display different page layouts using only one template.

After upgrade to 1.10 solution I have used before didn't work anymore. Here it is:
\$1:
{if FALSE!==$content_obj->mProperties->mPropertyValues.extra1|strpos:'slider'}...{else}...{/if}


I couldn't use simple construction {is $extra1 == 'slider'} because on some pages I had more than one word in extra1 field like 'slider' and 'notitle'.

Calguy pointed that their solution of the box. Just read help. Well there is much help for use of {page_attr} tag and no examples at all.

So with help of people from IRC channel solution in my case for 1.10 looks like this:

\$1:
  {page_attr key='extra1' assign='extra1'}
   {if $extra1|strstr:'slider' != ''}...{else}...{/if}


if I want to display slider.

Author:  Dr.CSS [ Fri Oct 28, 2011 5:53 pm ]
Post subject:  Re: [SOLVED] After CMSMS 1.10 upgrade pages are broken

There are 3 'extra' fields, why not use each one for each call instead of trying to put them all in one?...

Author:  ofrost [ Mon Oct 31, 2011 9:09 am ]
Post subject:  Re: [SOLVED] After CMSMS 1.10 upgrade pages are broken

I need more than three. So there must be two conditions in one extra field.

And it was done that way from the beginning. It's hard to make it different. Too many pages.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/