ccburns

Oh that’s simple… Just wanted to make sure I wasn’t missing some sort of convention… cheers @tonyair

ccburns

Sorry I know I am asking a question that has probably been asked a million times, I know I am very late to the game but starting working on a site in SS4 (I work for a company that has a legacy SS3 project).

In SS3 I used to just create different (private) modules at the root level. Where is the ideal place to create these SS modules in SS4. Do I create them in the /app directory?

These are private modules just to help keep my files a little more organised so they won’t be installed via composer and are project specific…

ccburns

I don’t think something like this works ProfileController::create()->render($params); but I imagine there is a way to render the content for /profile/<username and then display it

ccburns

What I was originally doing in the handleRequest() method was

  1. original code checked if there was a page in the SiteTree
  2. I then added a check to see what controllers urls were set up using $directorRules = Config::inst()->get('Director', 'rules');
  3. I made this into an array and checked if the <username> parameter was in this list…
  4. If it was in the list then I would let SS render as it usually would
  5. If it wasn’t in this list then I would check if the username existed
  6. If it doesn’t exist then I would let SS take control and it would return a 404 error
  7. If the user name did exist then I wanted to try and render the ProfileController page (passing in the $username and any other values I needed) and then render it

I was stuck on point 7. Which I think would be the same situation if I user handleAction() although as I say I could be just not understanding properly.

ccburns

This is my current routing for that 'profile/$username/$Action/$ID/$OtherID': 'ProfileController'

ccburns

I guess what I am not understanding is how I get the content from the ProfileController to display at this location…

ccburns

Ok just having a quick play with that code, I maybe back in a few mins to ask more questions 😉