7940 Posts in 1543 Topics by 946 members
|Go to End||Next >|
20 August 2009 at 10:43pm
Hi Uncle Cheese
Am I right in saying the above code works with the existing ResourcePage and Resource files I have setup. I set up new pages MyResourceHolder.php and MyResourceHolder.ss. Use this as an include file in my existing ResourcePage.ss. Am I missing something here.
21 August 2009 at 1:12am
No, I was just using "MyResourceHolder" as an example name. Use whatever class you were using. You don't need to create a subclass or anything.
21 August 2009 at 6:03am
Maybe I am missing something very obvious but I tried creating the new page type ResouceHolderPage.php and ResourceHolderPage.ss, nothing crashed but the page came up empty. From looking at your post am I right in saying that I should be calling it by the the url /my-resource-holder/category/foo ? I couldn't get that to work either, I am trying to get a a set of data sorted, putting the data in had been straight forward with your module but I'm not sure how to list it on the front end. Ideally I wan to be able to have a list of all the categories and clicking on that will take you to a list of what is in the category, then from there clicking on a title will take you to the object with all the corresponding information about it.
So for example first list could be trains, planes, automobiles. By clicking on automobiles you will get mustang, ferrari and cadillac.
You can then also tag the objects by another list such as ground, air. Clicking on air gets you a list of ...........
Anyway I really appreciate all the help.
21 August 2009 at 6:18am
Post your code?
21 August 2009 at 6:52am
Hi Uncle Cheese
Thanks for the really quick reply once again. Basically very similar to what you are doing but I want it so you could get to the end results from different directions. So suppose all were sorted by two and four legged. Then two legged would take you to squirrels(mammals) and I can't think of any two legged reptiles now but perhaps some lizards? Or you could start from the top and go down by animal group i.e.(mammals, birds, reptiles). Then you could also group them up by say skin type i.e. (hairy, no hair, scales, slimey).
So then when you put an animal in you would choose the category then select what animal type, legs, skin type, etc.
Also I have looked around for a while and couldn't find a way anywhere of doing it but is there anyway in SilverStripe to have extended Urls's . i.e. in your case http://imt.carlinowebdesign.com/mammals/dogs/
21 August 2009 at 7:24am
Nested urls are currently not supported in the stable release of Silverstripe. There is a nested URLs branch but it's not part of the official release right now. And, oh yeah, it breaks DOM.
If you give me an email addy I can send you that code and you can tinker with it as you see fit.
21 August 2009 at 7:54am
Yeah, it's a huge criticism of SS, and they're well aware of the need for it. Like I said, there is a functional branch of SS that uses nested URLs. I don't have any experience with it, but apparently they're going to merge it into the trunk in 2.4. I think.
That said, the URL is set up to take arbitrary parameters using /action/ID/OtherID for your controllers by default, or you can set up your own implementations for URL rules. But the idea of /parent-url-segment/child-url-segment is not native.
Glad you're liking SS. It's definitely a breath of fresh air, especially for a programmer. Doesn't box you in the way Drupal does. I just gives you a framework to use, and you can make what you want with it. I really like their philosophy in that regard. Not to mention it's rigidly MVC, and last time I looked into Drupal, I wanted to bang my head looking at all those print() statements in the "templates". Ugh!
Send you an email. Will remove your last post to keep the spam bots away. Good luck!
|Go to Top||Next >|