[SOLVED] After CMSMS 1.10 upgrade pages are broken

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
ofrost
Forum Members
Forum Members
Posts: 47
Joined: Tue May 01, 2007 8:52 pm

[SOLVED] After CMSMS 1.10 upgrade pages are broken

Post 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?
Last edited by ofrost on Fri Oct 28, 2011 5:33 pm, edited 1 time in total.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Post 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
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
ofrost
Forum Members
Forum Members
Posts: 47
Joined: Tue May 01, 2007 8:52 pm

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Post 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?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
ofrost
Forum Members
Forum Members
Posts: 47
Joined: Tue May 01, 2007 8:52 pm

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Post 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.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Post 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.
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
ofrost
Forum Members
Forum Members
Posts: 47
Joined: Tue May 01, 2007 8:52 pm

Re: After CMSMS 1.10 upgrade pages are not displaying correc

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

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

Post 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?...
ofrost
Forum Members
Forum Members
Posts: 47
Joined: Tue May 01, 2007 8:52 pm

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

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

Return to “[locked] Installation, Setup and Upgrade”