Manage "View Websiite" URL

5 posts by 2 authors in: Forums > CMS Builder
Last Post: April 8, 2009   (RSS)

By crawf - April 7, 2009

What I have done is to change the view website url for some users to a specific url for each user by editing header.php as shown in other posts.
if ($username == 'sample') { $viewUrl = "http://sample.com"; }

However for other users, I want to change it to the url of the details page for the current section editor they are using. That also seems easy to do provided that there is a variable whose scope includes header.php and which contains that url. Hopefully we can do something like:
if ($username == 'sample2') { $viewUrl = $current_detail_viewer_url; }

Is such a variable available?

Re: [crawf] Manage "View Websiite" URL

By ross - April 7, 2009

Hi there.

Thanks for posting!

CMS Builder doens't keep track of the URL each section is being used on.

What I think you'll need to do is create a switch block to change that URL on a section by section basis.

You'll notice that when you click into a section, the section's table name is in the URL. That's what you'll want to do your switch on:

switch (get table name from url) {

case "section 1": url = someting.php; break;

}


This code doesn't work exactly like that but it should give you an idea. We don't really recommend making changes like this to the interface templates as there is a lot of different things going on in there. Also, the next time you upgrade, all these changes will be lost.

Let me know what you think :).

}
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Manage "View Websiite" URL

By crawf - April 7, 2009

Thanks! Works like a charm! A bit awkward but it does the job.

I'm aware that I need to save the mods and insert them into the next update. Inconvenient but not a big problem compared to the benefits I can get from it.

It would be nice if CMSB had a hierarchical assignment of the view website url. If there was a field for a viewing url and a field for viewing choices in the user account setup, then there could be a choice of using the default url from settings, using a url specified for the user, or using the url from the section viewer url (which CMSB could presumably get easily from the schema files).

Re: [crawf] Manage "View Websiite" URL

By ross - April 8, 2009

Hi there.

Glad that worked. I do like the idea of being able to change that view website link on a per section basis. I am adding that to the list and we'll see what the options end up being.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/