I have added price in my dataobject. but i need to add function: if price bigger than 50000 then it shows other link than normally.
Can someone help me with that. The price is textfield not currency.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
DataObjectManager Module /
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba
Need help with price field
public function BigPrice() {
return $this->Price > 50000;
}
---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com
And then the link in theme i use:
<% if BigPrice %>
show content over 50000
<% else %>
less than 50000
<% end_if %>
true of false
Yup!
---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com