Investor area, best way to layout permission-only pages
#22
Posted 20 April 2012 - 08:49 AM
Thanks Ryan, but correct me if I'm wrong, if we wanted say the 'rates' for 'Property 1' in the properties section, then the page properties/property_1/rates would still need to be created in the backend? So essentially each property would end up with a child, all called rates?
When you enable the URL segments option for a given template (Templates > Edit Template > URLs > URL Segments) then PW will accept non-existant URLs, so long as they start with one that does exist. So lets say that you have a page called /products/widget/. If URL segments are enabled, then you could access any URL below that and it would be sent to /products/widget/. So accessing /products/widget/photos/ (a page that doesn't exist) would still get sent to /products/widget/. (If URL segments are not enabled, then of course accessing /products/widget/photos/ would generate a 404 instead.)
Using the /products/widget/photos/ URL, the 'photos' portion would be considered URL segment 1. You can check the value of URL segment 1 in your template file with $input->urlSegment1. If there were another segment on there too, like, /products/widget/photos/cats/ then 'cats' would be URL segment 2 ($input->urlSegment2), and so on.
The advantage of URL segments is that you can have just 1 page handling many URLs. The portion of those URLs that are translated to URL segments are not pages in PW. In fact, if you actually created a page in PW named /products/widget/photos/, then your 'widget' page would no longer receive the 'photos' URL segment, as the new photos page would then have control over it.
#23
Posted 20 April 2012 - 10:35 AM
When you enable the URL segments option for a given template (Templates > Edit Template > URLs > URL Segments) then PW will accept non-existant URLs, so long as they start with one that does exist. So lets say that you have a page called /products/widget/. If URL segments are enabled, then you could access any URL below that and it would be sent to /products/widget/. So accessing /products/widget/photos/ (a page that doesn't exist) would still get sent to /products/widget/. (If URL segments are not enabled, then of course accessing /products/widget/photos/ would generate a 404 instead.)
Using the /products/widget/photos/ URL, the 'photos' portion would be considered URL segment 1. You can check the value of URL segment 1 in your template file with $input->urlSegment1. If there were another segment on there too, like, /products/widget/photos/cats/ then 'cats' would be URL segment 2 ($input->urlSegment2), and so on.
The advantage of URL segments is that you can have just 1 page handling many URLs. The portion of those URLs that are translated to URL segments are not pages in PW. In fact, if you actually created a page in PW named /products/widget/photos/, then your 'widget' page would no longer receive the 'photos' URL segment, as the new photos page would then have control over it.
Thanks Ryan that sounds exactly what I was looking for. So in theory I could put an include within an if urlSemgent test and output a whole new template. This would basically allow me to replicate EE's templating system somewhat?
#24
Posted 21 April 2012 - 11:02 AM
#25
Posted 01 November 2012 - 07:04 AM
/students/geography includes a geography_students.inc file.
My problem is that underneath /students/ is the "student" template so
/students/joe-bloggs displays using the "student" template but I want to add a link to "edit profile" from this particular student page and I'm trying to include an "edit_profile.inc" file but I don't know whether this would be a urlSegment2 of the "students" template or a urlSegment1 of the "student" template.
I have tried both, but neither seem to work, any ideas on how to implement this?
Thanks gang!
Also tagged with one or more of these keywords: roles, member area
Community Support →
General Support →
Is it possible to add a field to a specific user role?Started by jlahijani, Today, 05:02 PM |
|
|
||
Community Support →
General Support →
Default landing page for specific roleStarted by tinacious, 06 Apr 2013 |
|
|
||
Community Support →
General Support →
Can I limit page editing to the user that created that page?Started by tinacious, 06 Apr 2013 |
|
|
||
Community Support →
Getting Started →
Enabling a non-superuser to add pages via AsmSelectStarted by alanfluff, 28 Mar 2012 |
|
|
||
solved
Community Support →
Getting Started →
new user role can't publish...must be missing something.Started by evan, 29 Feb 2012 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













