url numbers instead of labels
6 posts by 2 authors in: Forums > CMS Builder
Last Post: February 6, 2012 (RSS)
By rez - February 3, 2012
unfortunately, this is making my urls numbers instead of the labels. Is there a way to use the labels for the urls? i dont want to have to make a redundant field.
thanks for the help.
Re: [rez] url numbers instead of labels
By (Deleted User) - February 3, 2012
The viewer and detail pages for a table can be set in Admin->Section Editors->TABLE->Viewer Urls - once set here the link to a record from that table can be set with $record['_link'] which will automatically add the appropriate record number to the end of a link.
To add a more detailed name (in this case, the title of a record), set Filename Fields to 'title' - this will set the url to "viewerPage.php?Title-Taken-From-Title-Field-120" where "120" is the record number.
Let me know if this helps,
Tom
Re: [Tom P] url numbers instead of labels
By rez - February 3, 2012
The "viewerPage.php?Title-Taken-From-Title-Field-120
Looks like
"viewerPage.php?52-120
Not very friendly. I have to use num. How can use the label in the link instead of num?
Thanks
Re: [rez] url numbers instead of labels
By (Deleted User) - February 3, 2012
If I've got this right, you're building the link using a list of "num from foreign table"=>"name from foreign table" called "title".
Using just "title" to refer to the field will use the value of that field (in this case, 'num from foreign table') - cmsb uses pseudo-fields to show the label for a value when referring to another table.
You can use this pseudo field in the viewer settings by calling "title:label" which will refer to the label of the value instead of the value itself.
Pseudo fields can also be used for the general viewers.
Let me know if this helps,
Tom
Re: [Tom P] url numbers instead of labels
By rez - February 4, 2012
If I could put title:label in the viewer url section of cmsb admin, that would be great but doesn't seems to work.
Re: [rez] url numbers instead of labels
By (Deleted User) - February 6, 2012
You're right, the :label isn't handled correctly by the viewer url field! My mistake.
This functionality could be added with a plugin.
If anyone has written one that already does this, please let us know!
Otherwise we'd have to look at building a custom plugin.
Tom