That should totally work. Nothing complicated going on. Are you using $allowed_actions by any chance? Can you attach your whole php file?
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.
- Previous 10 entries
- 1
- Page 22(current)
Tried to find documentation that explained $allowed_actions but didn't see any.
Oh maaan socks you have all kinds of problems.
1. Your class names don't match your file names, this won't be an issue in 2.4 but it is in 2.3 and below
2. You copied my psudo code which doesn't actually work. The DataObject::get call should throw all kinds of errors
3. You are calling the controller action in your template as a control
You are missing a whole lot of Silverstripe 101 in the attached code.
Brush up on tutorial 2 for the controller
http://doc.silverstripe.org/doku.php?id=tutorial:2-extending-a-basic-site
And for the template rendering hit up tutorial 4
http://doc.silverstripe.org/doku.php?id=tutorial:4-site-search#showing_the_results
How'd I go from so close to not knowing the basics. I had this working fine when I actually had a page type GoogleMapXml.php and a page in the CMS, but trying to by-pass the CMS and spit out the DataObjects directly to a template is something I haven't done before. Since I still don't see documentation that explains this well enough I'm not sure what to do besides ask for help.
1. Your class names don't match your file names, this won't be an issue in 2.4 but it is in 2.3 and below
If you're talking about Page5.php doesn't match my Page class..that's this forum renaming my file.
I'll just start another thread and see if someone else can help.
thank you.
I'll just start another thread and see if someone else can help.
Whats wrong with this thread?
Aww c'mon socks, don't stomp off and pout. Building off the last post I wrote with code addressing point 3:
GoogleMapXml.ss
<?xml version="1.0" encoding="UTF-8"?>
<markers>
<% control Stores %>
<marker address="$Address" city="$City" state="$State" zip="$Zip" phone="$Phone" lat="$Lat" lng="$Lng" delivery="$Delivery" notation="$Notation"></marker>
<% end_control %>
</markers>
This is all explained in detail with working code examples here, except you are returning a DataSet of StoreLocations instead of Search Results: http://doc.silverstripe.org/doku.php?id=tutorial:4-site-search#showing_the_results
Hello Guys,
Here is ready to use USA/Canada Store Locator solution.
http://www.php4script.com/store-locator-script/
I hope it will helpfull someone
Oi socks did you finally realized the store locator?
This is exactly what i need to do at the moment.
Thks for your feedback.
- Previous 10 entries
- 1
- Page 22(current)