Jump to content

Recommended Posts

Posted

Hi,

ran into a weird range slider error.

I have a range slider "size" with a number 1-3. Sometimes I want to override the value in the cms by doing $my_page->size = 3, or similar. Works fine most of the cases, except in one particular page where I get

Error:     Exception: Page '/page/path/' is not currently viewable. (in /Applications/MAMP/htdocs/vandejong/wire/modules/PageRender.module line 218)

...if I try to echo $my_page->size.

If I try to set it, it becomes "1" regardless of what value I try to set it to. 

anyone seen this? 

thanks!

J

Posted

So there is something wrong with that page? Is it unpublished or some permissions set? Any more details would help.

Posted

Ah, it's simpler than I thought. I don't seem to be able to set any value in php of a range slider field

$my_page->my_rangeslider = whatever integer

  always becomes

echo $my_page->my_rangeslider; // 1

Posted

no biggie, made an easy workaround by using another variable for setting and overriding the range slider value

J

Posted

Can you tell a little more what the field settings are set to?

Ok it's a litte special with this field because it also supports "range" setting (min,max).

So it has two values actually and uses outputformatting because is an object behind the scenes. To set the value in template code you need to turn it off and use 

$page->of(false);
$page->range->set("min", 3);
$page->of(true);
or 
$page->of(false);
$page->range->min = 3;
$page->of(true);
  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...