Page 1 of 1

[SOLVED] After CMSMS 1.10 upgrade pages are broken

Posted: Thu Oct 27, 2011 7:57 am
by ofrost
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?

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Posted: Thu Oct 27, 2011 8:37 am
by fredp
Hi,

I suggest you read through the CMSMS 1.10 API docs.

I think this might be what you're looking for:

Code: Select all

$xtra1 = $content->GetPropertyValue('extra1');
Hope this helps,
fredp

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

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Posted: Thu Oct 27, 2011 1:02 pm
by ofrost
Thank you Fred.
This string moves me further

Code: Select all

{if FALSE!==$content_obj->GetPropertyValue('extra1')|strpos:´slider´}
but now I get this error

Code: Select all

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?

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Posted: Thu Oct 27, 2011 2:17 pm
by calguy1000
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.

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Posted: Thu Oct 27, 2011 2:55 pm
by ofrost
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.

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Posted: Thu Oct 27, 2011 8:36 pm
by fredp
@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.

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Posted: Fri Oct 28, 2011 5:32 pm
by ofrost
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:

Code: Select all

{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:

Code: Select all

  {page_attr key='extra1' assign='extra1'}
   {if $extra1|strstr:'slider' != ''}...{else}...{/if} 
if I want to display slider.

Re: [SOLVED] After CMSMS 1.10 upgrade pages are broken

Posted: Fri Oct 28, 2011 5:53 pm
by Dr.CSS
There are 3 'extra' fields, why not use each one for each call instead of trying to put them all in one?...

Re: [SOLVED] After CMSMS 1.10 upgrade pages are broken

Posted: Mon Oct 31, 2011 9:09 am
by ofrost
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.